fluent-plugin-nais 0.35.0 → 0.36.0
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 +25 -24
- data/lib/fluent/plugin/nais/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d011ea18c2cae66f5139d8c1adf827d24b368052
|
4
|
+
data.tar.gz: 935f0bb6a1da24ae45b26b809d60512038829527
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3521542ac90b51bcdacc23e028ebf07e32a144096137e397cb08fb83044ad245d478292cac6ba69ef35da7d4d6a6842bdf177536d03211e00ac68389d46ed441
|
7
|
+
data.tar.gz: 9abd4476a218dbea14cc6de1ceb10b2c8718f64405cd66820fdf8d811c26cfe2f4634152775a64cdab6e5633eeecdcdaa6ec95cc5c9b02c94def2d0aa1124b64
|
@@ -6,6 +6,7 @@ module Fluent::Plugin
|
|
6
6
|
class NaisLogformatFilter < Filter
|
7
7
|
Fluent::Plugin.register_filter('nais_logformat', self)
|
8
8
|
config_param :logformat, :string, default: ""
|
9
|
+
config_param :field, :string, default: "log"
|
9
10
|
|
10
11
|
def configure(conf)
|
11
12
|
super
|
@@ -20,74 +21,74 @@ module Fluent::Plugin
|
|
20
21
|
unless formats.nil? || formats == ""
|
21
22
|
formats.split(',').each {|fmt|
|
22
23
|
if fmt == 'accesslog'
|
23
|
-
r = ::Nais::Log::Parser.parse_accesslog(record[
|
24
|
+
r = ::Nais::Log::Parser.parse_accesslog(record[@field])
|
24
25
|
unless r.nil?
|
25
26
|
r = r[0]
|
26
|
-
r[
|
27
|
+
r[@field] = r.delete('request')
|
27
28
|
level = ::Nais::Log::Parser.loglevel_from_http_response(r['response_code'])
|
28
29
|
r['level'] = level unless level.nil?
|
29
30
|
end
|
30
31
|
elsif fmt == 'accesslog_with_processing_time'
|
31
|
-
r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record[
|
32
|
+
r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record[@field])
|
32
33
|
unless r.nil?
|
33
|
-
r[
|
34
|
+
r[@field] = r.delete('request')
|
34
35
|
level = ::Nais::Log::Parser.loglevel_from_http_response(r['response_code'])
|
35
36
|
r['level'] = level unless level.nil?
|
36
37
|
end
|
37
38
|
elsif fmt == 'accesslog_with_referer_useragent'
|
38
|
-
r = ::Nais::Log::Parser.parse_accesslog_with_referer_useragent(record[
|
39
|
+
r = ::Nais::Log::Parser.parse_accesslog_with_referer_useragent(record[@field])
|
39
40
|
unless r.nil?
|
40
|
-
r[
|
41
|
+
r[@field] = r.delete('request')
|
41
42
|
level = ::Nais::Log::Parser.loglevel_from_http_response(r['response_code'])
|
42
43
|
r['level'] = level unless level.nil?
|
43
44
|
end
|
44
45
|
elsif fmt == 'capnslog'
|
45
|
-
r = ::Nais::Log::Parser.parse_capnslog(record[
|
46
|
+
r = ::Nais::Log::Parser.parse_capnslog(record[@field])
|
46
47
|
unless r.nil?
|
47
|
-
r[
|
48
|
+
r[@field] = r.delete('message')
|
48
49
|
end
|
49
50
|
elsif fmt == 'logrus'
|
50
|
-
r = ::Nais::Log::Parser.parse_logrus(record[
|
51
|
+
r = ::Nais::Log::Parser.parse_logrus(record[@field])
|
51
52
|
unless r.nil?
|
52
|
-
r[
|
53
|
+
r[@field] = r.delete('msg')
|
53
54
|
end
|
54
55
|
elsif fmt == 'gokit'
|
55
|
-
r = ::Nais::Log::Parser.parse_gokit(record[
|
56
|
+
r = ::Nais::Log::Parser.parse_gokit(record[@field])
|
56
57
|
unless r.nil?
|
57
58
|
r['msg'] = r['err'] if r.has_key?('err') && !r.has_key?('msg')
|
58
|
-
r[
|
59
|
+
r[@field] = r.delete('msg')
|
59
60
|
end
|
60
61
|
elsif fmt == 'rook'
|
61
|
-
r = ::Nais::Log::Parser.parse_rook(record[
|
62
|
+
r = ::Nais::Log::Parser.parse_rook(record[@field])
|
62
63
|
unless r.nil?
|
63
|
-
r[
|
64
|
+
r[@field] = r.delete('message')
|
64
65
|
end
|
65
66
|
elsif fmt == 'redis'
|
66
|
-
r = ::Nais::Log::Parser.parse_redis(record[
|
67
|
+
r = ::Nais::Log::Parser.parse_redis(record[@field])
|
67
68
|
unless r.nil?
|
68
|
-
r[
|
69
|
+
r[@field] = r.delete('message')
|
69
70
|
end
|
70
71
|
elsif fmt == 'coredns'
|
71
|
-
r = ::Nais::Log::Parser.parse_coredns(record[
|
72
|
+
r = ::Nais::Log::Parser.parse_coredns(record[@field])
|
72
73
|
unless r.nil?
|
73
|
-
r[
|
74
|
+
r[@field] = r.delete('message')
|
74
75
|
end
|
75
76
|
elsif fmt == 'simple'
|
76
|
-
r = ::Nais::Log::Parser.parse_simple(record[
|
77
|
+
r = ::Nais::Log::Parser.parse_simple(record[@field])
|
77
78
|
unless r.nil?
|
78
|
-
r[
|
79
|
+
r[@field] = r.delete('message')
|
79
80
|
end
|
80
81
|
elsif fmt == 'glog'
|
81
|
-
r = ::Nais::Log::Parser.parse_glog(record[
|
82
|
+
r = ::Nais::Log::Parser.parse_glog(record[@field])
|
82
83
|
unless r.nil?
|
83
84
|
r['source'] = r['file']+':'+r.delete('line')
|
84
85
|
r['component'] = r.delete('file')
|
85
|
-
r[
|
86
|
+
r[@field] = r.delete('message')
|
86
87
|
end
|
87
88
|
elsif fmt == 'influxdb'
|
88
|
-
r = ::Nais::Log::Parser.parse_influxdb(record[
|
89
|
+
r = ::Nais::Log::Parser.parse_influxdb(record[@field])
|
89
90
|
unless r.nil?
|
90
|
-
r[
|
91
|
+
r[@field] = r.delete('message')
|
91
92
|
if r['component'] == 'httpd'
|
92
93
|
level = ::Nais::Log::Parser.loglevel_from_http_response(r['response_code'])
|
93
94
|
r['level'] = level unless level.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-nais
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Terje Sannum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|