fluent-plugin-protocols-filter 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-protocols-filter.gemspec +1 -1
- data/lib/fluent/plugin/filter_protocols.rb +5 -6
- 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: 2eb673e89070c7046862f5a76e6538cac3786ad0
|
4
|
+
data.tar.gz: 657975a732973723e1738326c4a4b9de2e88fe96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65e2194fd4c1f049fa9fe105c62fe21a5f8814c6e1a630a7ac25b85b93ff1bd291eb662d36616a3834ca2a96fc76b910fc1fc63d04d3d2512c440231da9e393d
|
7
|
+
data.tar.gz: 89da013cf6120b758b1d15e318bc72b8056d299176b2484d595fdf51409b81cf36edf11322967bd70b9c1413551e999c4e78628e84adda87877a113347ce7bdd
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-protocols-filter"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.3"
|
8
8
|
spec.authors = ["Tokyo Home SOC"]
|
9
9
|
spec.email = ["github@homesoc.tokyo"]
|
10
10
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require "csv"
|
2
2
|
|
3
|
-
module Fluent
|
3
|
+
module Fluent::Plugin
|
4
4
|
class ProtocolsFilter < Filter
|
5
|
-
Plugin.register_filter('protocols', self)
|
5
|
+
Fluent::Plugin.register_filter('protocols', self)
|
6
6
|
|
7
7
|
config_param :database_path, :string, :default => File.dirname(__FILE__) + '/../../../protocolslist/service-names-port-numbers.csv'
|
8
8
|
config_param :key_port, :string, :default => 'port'
|
@@ -17,12 +17,12 @@ module Fluent
|
|
17
17
|
@key_prefix = @key_port + "_" + @key_prefix
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
new_es = MultiEventStream.new
|
20
|
+
def filter_stream(tag, es)
|
21
|
+
new_es = Fluent::MultiEventStream.new
|
22
22
|
tag = tag.sub(@remove_prefix, '') if @remove_prefix
|
23
23
|
tag = (@add_prefix + '.' + tag) if @add_prefix
|
24
24
|
|
25
|
-
es.each do |time,record|
|
25
|
+
es.each do |time, record|
|
26
26
|
unless record[@key_port]
|
27
27
|
record[@key_prefix] = getprotocolname(record[@key_port], record[@key_proto]) rescue nil
|
28
28
|
end
|
@@ -42,6 +42,5 @@ module Fluent
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
46
45
|
end
|
47
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-protocols-filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tokyo Home SOC
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|