fluent-plugin-kube-events-timestamp 0.1.2 → 0.1.3
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: 7d07b51bbba681686b828a84d1d6409d5f73c7170234140e329aedf647a9fe6f
|
4
|
+
data.tar.gz: 3a6b32685e62999531a959f446e2a5501ceaa3c7a4ad4c13aa9cb12c6eb781aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46e7f6a6b443c04e527c2fcf994c388faec19cacc9e84a0d9cfc3004f9471781a71854380443f0ce29acc872c9264105eaabdc7b345d0b432da6605547cfe782
|
7
|
+
data.tar.gz: 1d99e7ac2f50e4c5d939423aa28c483ea63a51c1cff7f11cefaefb5ae7d9c1a68ef8a1ca82d65ee417097a001e21cba056582e8e6cb05770c2d4a021dfbb139a
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "fluent-plugin-kube-events-timestamp"
|
3
|
-
spec.version = "0.1.
|
3
|
+
spec.version = "0.1.3"
|
4
4
|
spec.authors = ["Banzai Cloud"]
|
5
5
|
spec.email = ["info@banzaicloud.com"]
|
6
6
|
spec.description = %q{fluent filter plugin to map multiple timestamps into an additional one}
|
@@ -34,7 +34,11 @@ module Fluent::Plugin
|
|
34
34
|
|
35
35
|
def filter(tag, time, record)
|
36
36
|
|
37
|
-
|
37
|
+
vals=@timestamp_fields.map do |field|; getin(record, field); end
|
38
|
+
|
39
|
+
record[@mapped_time_key] = (vals[0].to_s.empty?) ? (vals[1].to_s.empty?) ? vals[2] : vals[1] : vals[0]
|
40
|
+
|
41
|
+
# record[@mapped_time_key] = (getin(record,@timestamp_fields[0]).to_s.empty?) ? (getin(record,@timestamp_fields[1]).to_s.empty?) ? getin(record,@timestamp_fields[2]) : getin(record,@timestamp_fields[1]) : getin(record,@timestamp_fields[0])
|
38
42
|
|
39
43
|
if record[@mapped_time_key].to_s.empty?
|
40
44
|
record[@mapped_time_key] = Time.at(time.is_a?(Fluent::EventTime) ? time.to_int : time).strftime(@strftime_format)
|