fluentd-tcp-capturer 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/bin/fm-cap +17 -2
- data/fluentd-tcp-capturer.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a71cc5adca6e8b36b61aaa40fdd9ba6f0c2ef26
|
4
|
+
data.tar.gz: 12a22d49369ce11b5cb1e99cbb6adaba939fd66b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10c8774cca0978d608873b3d88122d775d7fcac3a657e6931179de229d803f3dd3c72107e12b3445781ccc7fb395c9fce5120007e5e75ce3e64c48bba6687d78
|
7
|
+
data.tar.gz: a6aae5c4f55d97d2cb27df5d3f4622be6405c7cad65f078c94209aa858d3ec549ff8c8d77abbb51b22fc166823b5396618aa4d31db232420af0838c94fedc27e
|
data/.gitignore
CHANGED
data/bin/fm-cap
CHANGED
@@ -7,7 +7,8 @@ options = {
|
|
7
7
|
device: "eth0",
|
8
8
|
port: 24224,
|
9
9
|
forward_host: nil,
|
10
|
-
forward_port: 0
|
10
|
+
forward_port: 0,
|
11
|
+
fluentd_config: nil
|
11
12
|
}
|
12
13
|
|
13
14
|
logger = Logger.new(STDOUT)
|
@@ -30,8 +31,21 @@ OptionParser.new do |opts|
|
|
30
31
|
opts.on("--debug", "Set loglevel DEBUG") do |v|
|
31
32
|
logger.level = Logger::DEBUG
|
32
33
|
end
|
34
|
+
opts.on("--fluentd-config PATH", "Config path for embed Fluentd (must be used with --forward-host/--forward-port)") do |v|
|
35
|
+
options[:fluentd_config] = v
|
36
|
+
end
|
33
37
|
# TODO max_bytes, timeout
|
34
38
|
opts.parse!(ARGV)
|
39
|
+
|
40
|
+
if !options[:fluentd_config].nil? && options[:forward_host].nil?
|
41
|
+
STDERR.write "--fluentd-config must be used with --forward-host/--forward-port\n"
|
42
|
+
exit 1
|
43
|
+
end
|
44
|
+
|
45
|
+
if !options[:forward_host].nil? && options[:forward_port] <= 0
|
46
|
+
STDERR.write "--forward-host must be used with --forward-port\n"
|
47
|
+
exit 1
|
48
|
+
end
|
35
49
|
end
|
36
50
|
|
37
51
|
|
@@ -39,7 +53,8 @@ exec = Capturing::Exec.new(device: options[:device], port: options[:port], logge
|
|
39
53
|
runner = if options[:forward_host].nil?
|
40
54
|
Capturing::PrintRunner.new(exec, writer: STDOUT)
|
41
55
|
else
|
42
|
-
Capturing::ForwardRunner.new(exec, host: options[:forward_host], port: options[:forward_port],
|
56
|
+
Capturing::ForwardRunner.new(exec, host: options[:forward_host], port: options[:forward_port],
|
57
|
+
fluentd_config: options[:fluentd_config])
|
43
58
|
end
|
44
59
|
|
45
60
|
|