fluent-plugin-nais 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fluent/plugin/filter_nais_logformat.rb +17 -15
- data/lib/fluent/plugin/nais/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f425cdac537c950a9682ecccb1810947b63c1988
|
4
|
+
data.tar.gz: dc7d0a3989a4deed1f36e8c78c32c1fec1fe0ae8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1912bbe15d0a5b03d706b967125781349b842ac99ea38e3c3cc38bdc14a8f27bf5714d9f98abe8cd0a532f8affb0d145cce86fa1c56566abb97e740e384eff5b
|
7
|
+
data.tar.gz: 9f318090fd16e45db1e84ed7bae2d95a71f3e4bc98b2ea95dda8641b6e91a88a1580237535cc5a233ae371275d3687cb735fca6fe3075751ef620f563578158a
|
@@ -11,22 +11,24 @@ module Fluent::Plugin
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def filter(tag, time, record)
|
14
|
-
fmt = record['kubernetes']['annotations']['nais_io/logformat']
|
15
14
|
r = nil
|
16
|
-
if
|
17
|
-
|
18
|
-
|
19
|
-
r =
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
r
|
29
|
-
|
15
|
+
if record['kubernetes'].is_a?(Hash) && record['kubernetes']['annotations'].is_a?(Hash)
|
16
|
+
fmt = record['kubernetes']['annotations']['nais_io/logformat']
|
17
|
+
if fmt == 'accesslog'
|
18
|
+
r = ::Nais::Log::Parser.parse_accesslog(record['log'])
|
19
|
+
unless r.nil?
|
20
|
+
r = r[0]
|
21
|
+
r['log'] = r.delete('request')
|
22
|
+
end
|
23
|
+
elsif fmt == 'accesslog_with_processing_time'
|
24
|
+
r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record['log'])
|
25
|
+
r['log'] = r.delete('request') unless r.nil?
|
26
|
+
elsif fmt == 'glog'
|
27
|
+
r = ::Nais::Log::Parser.parse_glog(record['log'])
|
28
|
+
unless r.nil?
|
29
|
+
r['component'] = r.delete('file')+':'+r.delete('line')
|
30
|
+
r['log'] = r.delete('message')
|
31
|
+
end
|
30
32
|
end
|
31
33
|
end
|
32
34
|
if r.nil?
|