fluent-plugin-record_indexing_test 0.2.2.1 → 0.2.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8af0a9c900d866f7932827a9ff76cd0799102b90b02907181ef5c7714992e9a
|
4
|
+
data.tar.gz: 641fc6d6f1f1854f5358ebb495a31cf8aad503b84d9ff3deefc607f39380b469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10133863becfbd5ef4cb77ff1c0e1d202991daf727d2494f6146e894c75f83a832eb4ca4e7ed7e6b52f37260cf78f8577ed5a5333c739cbd97e3518a241379cd
|
7
|
+
data.tar.gz: 12635ffbf6ad1c3482e6d8644b5165a62ab99b229422c743acfe9e9bb3a6f464d9fb742e64da555d8e142c441fc9b7fd462371bef32fa67c8d8c0cb55b7c2a4e
|
@@ -8,11 +8,11 @@ module Fluent
|
|
8
8
|
config_param :key_names, :array, default: []
|
9
9
|
config_param :key_prefix, :string, default: nil
|
10
10
|
config_param :check_all_key, :bool, default: true
|
11
|
-
config_param :ignore_length, :bool, default:
|
11
|
+
config_param :ignore_length, :bool, default: true
|
12
12
|
config_param :exclude_keys, :array, default: []
|
13
13
|
|
14
14
|
def filter(tag, time, record)
|
15
|
-
!@check_all_key && key_names.empty?
|
15
|
+
if !@check_all_key && key_names.empty?
|
16
16
|
raise ArgumentError, "key_names parameter is required if check_all_key set false"
|
17
17
|
end
|
18
18
|
new_record = {}
|
@@ -28,7 +28,7 @@ module Fluent
|
|
28
28
|
if @exclude_keys.include?(key)
|
29
29
|
new_record[key] = value # Keep the value as is without indexing
|
30
30
|
elsif value.is_a?(Array)
|
31
|
-
if
|
31
|
+
if !@ignore_length && value.length == 1
|
32
32
|
new_record[key] = value.first
|
33
33
|
else
|
34
34
|
new_record[key] = {}
|