fluent-plugin-syscheck 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fluent/plugin/in_syscheck_sockets.rb +17 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2bc041b693f90f1f23d310693316e2b701b0e50f2d1bd25a14c19262276a8fd4
|
|
4
|
+
data.tar.gz: ceedc1c200a01e263376648f13b76e61e206abbb6e1bd64b68f857daa0467731
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4dfaca6197db517be8144fb82e2d2a3acbf35b09ffacda6b407d33eff852f005d81fc535e0e3f2b19176c2681bdc68549fa33cb795c7cf5e2a27d022316c443
|
|
7
|
+
data.tar.gz: 75bf00cfaf0083a6ae528067f85e1dc7e16109a25aea28c75c609d841cbf98259d7b06b03e270aa8f44f77d46750d292191f8a3451e7a2bb7b9b7a0af78d47c7
|
|
@@ -88,18 +88,32 @@ module Fluent
|
|
|
88
88
|
|
|
89
89
|
event_time = Fluent::EventTime.from_time(sockets.timestamp)
|
|
90
90
|
sockets.each do |socket|
|
|
91
|
+
socket_event = sanitize_record(socket.to_h)
|
|
91
92
|
router.emit(
|
|
92
93
|
tag,
|
|
93
94
|
event_time,
|
|
94
|
-
|
|
95
|
-
.transform_keys(&:to_s)
|
|
96
|
-
.merge('timestamp' => sockets.timestamp.iso8601(3))
|
|
95
|
+
socket_event
|
|
97
96
|
)
|
|
98
97
|
end
|
|
99
98
|
end
|
|
100
99
|
|
|
101
100
|
private
|
|
102
101
|
|
|
102
|
+
def sanitize_record(record)
|
|
103
|
+
case record
|
|
104
|
+
when Hash
|
|
105
|
+
record.each_with_object({}) do |(k, v), new_hash|
|
|
106
|
+
new_hash[k.to_s] = sanitize_record(v)
|
|
107
|
+
end
|
|
108
|
+
when Array
|
|
109
|
+
record.map { |v| sanitize_record(v) }
|
|
110
|
+
when String, Integer, Float, TrueClass, FalseClass, NilClass
|
|
111
|
+
record
|
|
112
|
+
else
|
|
113
|
+
record.to_s
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
103
117
|
def read_file_content(path)
|
|
104
118
|
File.read(path)
|
|
105
119
|
rescue Errno::ENOENT => e
|