Class: AiRootShield::DeviceLogParser
- Inherits:
-
Object
- Object
- AiRootShield::DeviceLogParser
- Defined in:
- lib/ai_root_shield/device_log_parser.rb
Overview
Parses device logs and extracts relevant security information
Class Method Summary collapse
-
.parse(file_path) ⇒ Hash
Parse device logs from JSON file.
Class Method Details
.parse(file_path) ⇒ Hash
Parse device logs from JSON file
12 13 14 15 16 17 18 19 |
# File 'lib/ai_root_shield/device_log_parser.rb', line 12 def parse(file_path) raise Error, "Device logs file not found: #{file_path}" unless File.exist?(file_path) raw_data = JSON.parse(File.read(file_path)) normalize_device_data(raw_data) rescue JSON::ParserError => e raise Error, "Invalid JSON format in device logs: #{e.message}" end |