fluent-plugin-nais 0.11.0 → 0.12.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: 5b9e1201483827187da8dd5bea131086a4a0fd75
4
- data.tar.gz: c484d519e98a1bdf9db7d11e8896116dd0284c3b
3
+ metadata.gz: eac0dcc3822a859a8e26fb9236717ab83e101b4f
4
+ data.tar.gz: 465f3c510cc76e26ecf7b2584880596bd3adee21
5
5
  SHA512:
6
- metadata.gz: 62e41b5fac586ad0ff813150dc4aa0783c76198d1462f763786c62f85c3b0b63fd5f563556301fef1d10b4ce7ad0114ec56c49e398cf0b5346a8714c3a72fa63
7
- data.tar.gz: b4960488c01c52145aa63cd7e715158200b4eea6f3c1d3589b2871dc13f91fe118894546b16ff6fd6dda3d3cd0ca4a631ff4fad544d0197b7366160757a2e1c7
6
+ metadata.gz: 3b6b820fcf129a348c84866651d9e7ac117f1c408723a7997a224a865bcd6be43fb44c8bd56f5d8c5a9812b895a727aeb000000d3dc8c0a52fb3a129f0299b3b
7
+ data.tar.gz: 16df5c7cd7b8bdb63b5f1fa5dcbeae164b705416e111ad847f4346c5aea5e5be2597cc797a313d2c689f9723d0cb5e8bd1096098a6716c3ff0b2ec7c2024a569
@@ -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.14.0'
24
+ spec.add_dependency 'nais-log-parser', '~> 0.15.0'
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.15"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
@@ -0,0 +1,23 @@
1
+ require "fluent/plugin/nais/version"
2
+ require 'fluent/plugin/filter'
3
+ require 'nais/log/parser'
4
+
5
+ module Fluent::Plugin
6
+ class NaisKeywordsFilter < Filter
7
+ Fluent::Plugin.register_filter('nais_keywords', self)
8
+ config_param :field, :string
9
+ config_param :regex, :string
10
+
11
+ def configure(conf)
12
+ super
13
+ @re = Regexp.new(@regex)
14
+ end
15
+
16
+ def filter(tag, time, record)
17
+ keywords = ::Nais::Log::Parser.get_keywords(record['message'].to_s+' '+record['stack_trace'].to_s, @re)
18
+ record[@field] = keywords unless keywords.nil?
19
+ record
20
+ end
21
+
22
+ end
23
+ end
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Nais
4
- VERSION = "0.11.0"
4
+ VERSION = "0.12.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.11.0
4
+ version: 0.12.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-10-06 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -28,16 +28,16 @@ dependencies:
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.14.0
33
+ version: 0.15.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.14.0
40
+ version: 0.15.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -97,8 +97,8 @@ files:
97
97
  - bin/console
98
98
  - bin/setup
99
99
  - fluent-plugin-nais.gemspec
100
- - lib/fluent/plugin/filter_nais_exceptions.rb
101
100
  - lib/fluent/plugin/filter_nais_flatten_record.rb
101
+ - lib/fluent/plugin/filter_nais_keywords.rb
102
102
  - lib/fluent/plugin/filter_nais_logformat.rb
103
103
  - lib/fluent/plugin/filter_nais_logtransform.rb
104
104
  - lib/fluent/plugin/filter_nais_prefix_fields.rb
@@ -1,20 +0,0 @@
1
- require "fluent/plugin/nais/version"
2
- require 'fluent/plugin/filter'
3
- require 'nais/log/parser'
4
-
5
- module Fluent::Plugin
6
- class NaisExceptionsFilter < Filter
7
- Fluent::Plugin.register_filter('nais_exceptions', self)
8
-
9
- def configure(conf)
10
- super
11
- end
12
-
13
- def filter(tag, time, record)
14
- ex = ::Nais::Log::Parser.get_exceptions(record['message'].to_s+' '+record['stack_trace'].to_s)
15
- record['exception'] = ex unless ex.nil?
16
- record
17
- end
18
-
19
- end
20
- end