fluent-plugin-nais 0.23.0 → 0.24.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_kubeapiserver.rb +35 -0
- data/lib/fluent/plugin/nais/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd6a65da5a4221b783faf8089b5238302aafda16
|
4
|
+
data.tar.gz: 73e0daf5476b7c78d576736a4497b9aa185e746f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deb7dfdd9f28b4f879a04b0d14fc00bfe85f92624e5ca9849283a177a8d04b36bceee1ea3b6e4e008007c1c9a5170de2848de1bf10d6753f66ff113ee593e432
|
7
|
+
data.tar.gz: 13b9e96d04b37a53e8f84797f381304ba4031df9a2a8a938efd51947f4fc0463936e00ad1e7312ccba7adcc5dd790a47c91720e07660ab8b76abd5f52756dc91
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "fluent/plugin/nais/version"
|
2
|
+
require 'fluent/plugin/filter'
|
3
|
+
|
4
|
+
module Fluent
|
5
|
+
module Plugin
|
6
|
+
class NaisKubeApiserverFilter < Fluent::Plugin::Filter
|
7
|
+
Fluent::Plugin.register_filter('nais_kubeapiserver', self)
|
8
|
+
|
9
|
+
def filter(tag, time, record)
|
10
|
+
if record.has_key?('auditID')
|
11
|
+
record['x_level'] = record.delete('level')
|
12
|
+
record['level'] = 'Audit'
|
13
|
+
if record.has_key?('user')
|
14
|
+
if record['user'].has_key?('username')
|
15
|
+
if m = record['user']['username'].match(/^https:\/\/sts\.windows\.net.*\#(.*)/)
|
16
|
+
record['x_username'] = record['user']['username']
|
17
|
+
record['user'] = m[1]
|
18
|
+
else
|
19
|
+
record['user'] = record['user']['username']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
record['method'] = record.delete('verb') if record.has_key?('verb')
|
24
|
+
record['uri'] = record.delete('requestURI') if record.has_key?('requestURI')
|
25
|
+
record['remote_ip'] = record.delete('sourceIPs') if record.has_key?('sourceIPs')
|
26
|
+
record['@timestamp'] = record.delete('stageTimestamp') if record.has_key?('stageTimestamp')
|
27
|
+
record.delete('apiVersion')
|
28
|
+
record['message'] = record['method'] + ' ' + record['uri'] unless record.has_key?('message')
|
29
|
+
end
|
30
|
+
record
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
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.24.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-
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- fluent-plugin-nais.gemspec
|
100
100
|
- lib/fluent/plugin/filter_nais_flatten_record.rb
|
101
101
|
- lib/fluent/plugin/filter_nais_keywords.rb
|
102
|
+
- lib/fluent/plugin/filter_nais_kubeapiserver.rb
|
102
103
|
- lib/fluent/plugin/filter_nais_kubewatch.rb
|
103
104
|
- lib/fluent/plugin/filter_nais_logformat.rb
|
104
105
|
- lib/fluent/plugin/filter_nais_logtransform.rb
|