fluent-plugin-nais 0.30.0 → 0.31.0

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
  SHA1:
3
- metadata.gz: '088d42902132a64e080f5892e045e26408b344d6'
4
- data.tar.gz: a1edd1c16515fa778d510d49b9928597133f73eb
3
+ metadata.gz: 4416fb906c89fd3d36e929f15681b6bc531a62e7
4
+ data.tar.gz: 431ac16c27e69af77f1cc864ecf3ffc8742c576b
5
5
  SHA512:
6
- metadata.gz: b332324a0f4ff4c7e0672d6f99782a97bec7084c3c68f854e9c3358953755e7e8f5c3970640afabac518011f684b87f3e2fc5568b6b075e8f71d335f36b856c4
7
- data.tar.gz: 3a0bbe8fcc1e99ac1eae855b20066ff71587157c24dc25b2a67e1322a3f3be3e315fd9520ebf97125c78128195ef6322eb9eab0e2d55acfcd808e478bd68a3ee
6
+ metadata.gz: 7fcae511ef4fb9c1909789f9cad69f5d6de11fa61170b54e212fb3607b929984f1a2fd425ce13bbe531ad75ad2de7ec51597ae7542fb89de50863ab95034016b
7
+ data.tar.gz: 4c0f4b59f253f4a3519e3b01e61faffc54b9eaf29670ea2d5a5264dbfe2b895b71412bc0b0f13bf3925f73a1394c202a3ed403278c163c1ee3b9c8aad43c7a5a
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency 'fluentd', '~> 1.1'
24
- spec.add_dependency 'nais-log-parser', '>= 0.30.0'
23
+ spec.add_dependency 'fluentd', '~> 1.2'
24
+ spec.add_dependency 'nais-log-parser', '>= 0.31.0'
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.15"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
@@ -1,17 +1,36 @@
1
1
  require "fluent/plugin/nais/version"
2
2
  require 'fluent/plugin/filter'
3
- require 'nais/log/parser'
4
3
 
5
4
  module Fluent::Plugin
6
5
  class NaisRemapKubernetesFilter < Filter
7
6
  Fluent::Plugin.register_filter('nais_remap_kubernetes', self)
7
+ config_param :labels, :string, default: ""
8
8
 
9
9
  def configure(conf)
10
10
  super
11
11
  end
12
12
 
13
13
  def filter(tag, time, record)
14
- ::Nais::Log::Parser.remap_kubernetes_fields(record)
14
+ record["category"] = record.delete("stream") if record.has_key?("stream")
15
+ if record["docker"].is_a?(Hash)
16
+ record["container"] = record["docker"]["container_id"]
17
+ record.delete("docker")
18
+ end
19
+ if record["kubernetes"].is_a?(Hash)
20
+ record["host"] = record["kubernetes"]["host"]
21
+ record["namespace"] = record["kubernetes"]["namespace_name"]
22
+ record["application"] = record["kubernetes"]["container_name"]
23
+ record["pod"] = record["kubernetes"]["pod_name"]
24
+ if record["kubernetes"]["labels"].is_a?(Hash)
25
+ unless @labels.nil? || @labels == ""
26
+ @labels.split(',').each {|label|
27
+ record[label] = record["kubernetes"]["labels"][label] if record["kubernetes"]["labels"].has_key?(label)
28
+ }
29
+ end
30
+ end
31
+ record.delete("kubernetes")
32
+ end
33
+ record
15
34
  end
16
35
 
17
36
  end
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Nais
4
- VERSION = "0.30.0"
4
+ VERSION = "0.31.0"
5
5
  end
6
6
  end
7
7
  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.30.0
4
+ version: 0.31.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: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2018-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.1'
19
+ version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.1'
26
+ version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nais-log-parser
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.30.0
33
+ version: 0.31.0
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.30.0
40
+ version: 0.31.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement