fluent-plugin-pcapng 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/fluent-plugin-pcapng.gemspec +1 -1
- data/lib/fluent/plugin/in_pcapng.rb +2 -2
- data/test/test_in_ngpcap.rb +5 -0
- 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: eb4f5af91a684948ad0feee2ea46a9689a9bcfc3
|
4
|
+
data.tar.gz: 298aaeada09bfeb83dd7b8345e7493bc8e85dbd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6d9ecfff8537d1bbff964ec16bcc7d08f5caada3fd345e32297ee97e1b1486bc11c2d7debd451aaedd34e2631314f641b2d844aa25d1bd3a006cac620066120
|
7
|
+
data.tar.gz: 195d0d475432ff7b2ebe67184073741d031db79045dbe5ef30c69c17770c6fef987216299f1f9c13317dcd24f2ca2299808149e5593b622b26d3c4f974a41092
|
@@ -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-pcapng"
|
7
|
-
spec.version = "0.1.
|
7
|
+
spec.version = "0.1.2"
|
8
8
|
spec.authors = ["enukane"]
|
9
9
|
spec.email = ["enukane@glenda9.org"]
|
10
10
|
spec.description = %q{Fluentd plugin for tshark (pcapng) monitoring from specified interface}
|
@@ -77,7 +77,7 @@ module Fluent
|
|
77
77
|
def run
|
78
78
|
options = build_options(@fields)
|
79
79
|
options += build_extra_flags(@extra_flags)
|
80
|
-
cmdline = "tshark -i #{Shellwords(@interface)} -T fields -E separator=\",\" -E quote=d #{options}"
|
80
|
+
cmdline = "tshark -i #{Shellwords.escape(@interface)} -T fields -E separator=\",\" -E quote=d #{options}"
|
81
81
|
log.debug format("pcapng: %s", cmdline)
|
82
82
|
_stdin, stdout, stderr, @th_tshark = *Open3.popen3(cmdline)
|
83
83
|
|
@@ -96,7 +96,7 @@ module Fluent
|
|
96
96
|
def build_options(fields)
|
97
97
|
options = ""
|
98
98
|
fields.each do |field|
|
99
|
-
options += "-e #{Shellwords.escape(field)}"
|
99
|
+
options += "-e #{Shellwords.escape(field)} "
|
100
100
|
end
|
101
101
|
return options
|
102
102
|
end
|
data/test/test_in_ngpcap.rb
CHANGED
@@ -72,4 +72,9 @@ class PcapngInputTest < Test::Unit::TestCase
|
|
72
72
|
instance = create_driver(config).instance
|
73
73
|
assert_raise ArgumentError do instance.build_extra_flags(instance.extra_flags) end
|
74
74
|
end
|
75
|
+
|
76
|
+
def test_build_options_with_valid_flags
|
77
|
+
instance = create_driver.instance
|
78
|
+
assert_equal "-e frame.time_epoch -e dns.qry.name -e dns.qry.type -e dns.qry.class -e dns.id -e ip.src -e ip.dst ", instance.build_options(instance.fields)
|
79
|
+
end
|
75
80
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-pcapng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- enukane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|