fluent-plugin-nais 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-nais.gemspec +1 -1
- data/lib/fluent/plugin/filter_nais_logformat.rb +32 -0
- data/lib/fluent/plugin/nais/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77053c2957a21b76e805fc9f4e0b9c9755e34487
|
4
|
+
data.tar.gz: eaeea01eefbbb7c3dcb1406d1146beedd324cd1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc1ab36c46e28df9e150499c00f780ff0f6a7e9b7cd7b1c73e317324063a202a51d4f5ca83028cf90a5f619c8be94e515f175074037f4400b4aed68754fb3862
|
7
|
+
data.tar.gz: dbc68c5a1ee3509ead105f19358a4d7016d0ab71296edb44655e4c4b6be7f37cab44012d93122bc9efeb1639e91521d9ed274486a9e2afe60d3a8b9a50d0eadf
|
data/fluent-plugin-nais.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
23
|
spec.add_dependency 'fluentd', '~> 0.14'
|
24
|
-
spec.add_dependency 'nais-log-parser', '~> 0.
|
24
|
+
spec.add_dependency 'nais-log-parser', '~> 0.6'
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.15"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "fluent/plugin/nais/version"
|
2
|
+
require 'fluent/plugin/filter'
|
3
|
+
require 'nais/log/parser'
|
4
|
+
|
5
|
+
module Fluent::Plugin
|
6
|
+
class NaisLogformatFilter < Filter
|
7
|
+
Fluent::Plugin.register_filter('nais_logformat', self)
|
8
|
+
|
9
|
+
def configure(conf)
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def filter(tag, time, record)
|
14
|
+
fmt = record['kubernetes']['annotations']['nais.io/logformat']
|
15
|
+
r = nil
|
16
|
+
if fmt == 'accesslog'
|
17
|
+
r = ::Nais::Log::Parser.parse_accesslog(record['log'])
|
18
|
+
r = r[0] unless r.nil?
|
19
|
+
elsif fmt == 'accesslog_with_processing_time'
|
20
|
+
r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record['log'])
|
21
|
+
elsif fmt == 'glog'
|
22
|
+
r = ::Nais::Log::Parser.parse_glog(record['log'])
|
23
|
+
end
|
24
|
+
if r.nil?
|
25
|
+
record
|
26
|
+
else
|
27
|
+
record.merge(r)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
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.4.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: 2017-09-
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
40
|
+
version: '0.6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- fluent-plugin-nais.gemspec
|
100
100
|
- lib/fluent/plugin/filter_nais_exceptions.rb
|
101
101
|
- lib/fluent/plugin/filter_nais_flatten_record.rb
|
102
|
+
- lib/fluent/plugin/filter_nais_logformat.rb
|
102
103
|
- lib/fluent/plugin/filter_nais_prefix_nonstandard.rb
|
103
104
|
- lib/fluent/plugin/filter_nais_remap_elasticsearch.rb
|
104
105
|
- lib/fluent/plugin/filter_nais_remap_java.rb
|