fluent-plugin-nais 0.4.0 → 0.4.1
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 +10 -2
- 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: 2c85c792522daf8accb958d554993e69f07eb3fa
|
4
|
+
data.tar.gz: 03b923b8d36626915a92ed95c9a4b699368ff348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0510b12d30fc832178bedee7b4faa781dc44503d6a51ea53aa259d045761620b0f6ebff2bd499c0393f303ab9e6a3cb346497a18423c702ed9ec321ba6f4f5d
|
7
|
+
data.tar.gz: ad1e5b980be8889625f712c2ae0229e312b636f8b6af259e765902ca9af23f51a9e0097b5ded43e62850fa318d6e7f59fe28c887e1bd95812deae663321df6d8
|
@@ -11,15 +11,23 @@ module Fluent::Plugin
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def filter(tag, time, record)
|
14
|
-
fmt = record['kubernetes']['annotations']['
|
14
|
+
fmt = record['kubernetes']['annotations']['nais_io/logformat']
|
15
15
|
r = nil
|
16
16
|
if fmt == 'accesslog'
|
17
17
|
r = ::Nais::Log::Parser.parse_accesslog(record['log'])
|
18
|
-
|
18
|
+
unless r.nil?
|
19
|
+
r = r[0]
|
20
|
+
r['log'] = r.delete('request')
|
21
|
+
end
|
19
22
|
elsif fmt == 'accesslog_with_processing_time'
|
20
23
|
r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record['log'])
|
24
|
+
r['log'] = r.delete('request') unless r.nil?
|
21
25
|
elsif fmt == 'glog'
|
22
26
|
r = ::Nais::Log::Parser.parse_glog(record['log'])
|
27
|
+
unless r.nil?
|
28
|
+
r['component'] = r.delete('file')+':'+r.delete('line')
|
29
|
+
r['log'] = r.delete('message')
|
30
|
+
end
|
23
31
|
end
|
24
32
|
if r.nil?
|
25
33
|
record
|