fluent-plugin-druid-log 0.2.2 → 0.2.3
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/filter_format_druid_audit_log_2.rb +29 -10
- 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: a917348773c8eb3c1b2c3aa135e7587be2ab5840c4c9c05be0a639e423887261
|
|
4
|
+
data.tar.gz: 2ed0671eb16682447ba9602e438d3e2c46565039ee53a5c0350b27a6c13d4c5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c6ce7195abd5997cd003f036001d891269a304a6fd30cdc8dfc017971266acd0b7de2e51faae2523e85c3b79676c8430d609a9487b535568cf473a83d8199cc
|
|
7
|
+
data.tar.gz: f98b0df0d650e09fd2ad268004bbc8308e33f59228180ec7b57bb71c565105470d9c18baf6692b20ca32e7594c5316ccb138512cdf692fc2c62eb5022518d7f5
|
|
@@ -58,24 +58,43 @@ module Fluent
|
|
|
58
58
|
|
|
59
59
|
def fix_record(record)
|
|
60
60
|
fix_record_query_granularity(record)
|
|
61
|
+
fix_record_query_match_value(record)
|
|
62
|
+
fix_record_query_datasource_rows(record)
|
|
61
63
|
end
|
|
62
64
|
|
|
63
65
|
def fix_record_query_granularity(record)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
update_all_key_value(record['query'], 'granularity') do |value|
|
|
67
|
+
value&.to_s
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def fix_record_query_match_value(record)
|
|
72
|
+
update_all_key_value(record.dig('query', 'filter'), 'matchValue') do |value|
|
|
73
|
+
value&.to_s
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def fix_record_query_datasource_rows(record)
|
|
78
|
+
update_all_key_value(record.dig('query', 'dataSource'), 'rows') do |value|
|
|
79
|
+
value&.to_s
|
|
68
80
|
end
|
|
69
81
|
end
|
|
70
82
|
|
|
71
83
|
def update_all_key_value(record, key, &block)
|
|
72
|
-
record
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
case record
|
|
85
|
+
when Hash
|
|
86
|
+
record.each do |rkey, rvalue|
|
|
87
|
+
if rkey.to_s == key
|
|
88
|
+
record[rkey] = yield(rvalue) if block_given?
|
|
89
|
+
next
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
update_all_key_value(rvalue, key, &block)
|
|
93
|
+
end
|
|
94
|
+
when Array
|
|
95
|
+
record.each do |item|
|
|
96
|
+
update_all_key_value(item, key, &block)
|
|
76
97
|
end
|
|
77
|
-
|
|
78
|
-
update_all_key_value(rvalue, key, &block) if rvalue.is_a?(Hash)
|
|
79
98
|
end
|
|
80
99
|
end
|
|
81
100
|
end
|