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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4dcb9dbbf868d73eba8f6a055baa48190a59a90
4
- data.tar.gz: 783506485a2a324bcea6d5b5d34db904c58b2e63
3
+ metadata.gz: 8a71cc5adca6e8b36b61aaa40fdd9ba6f0c2ef26
4
+ data.tar.gz: 12a22d49369ce11b5cb1e99cbb6adaba939fd66b
5
5
  SHA512:
6
- metadata.gz: 4d33566f65d1e26ce4eaaaa241f1a96499c61055b53e138524505d0ff628de386d4d0dbb68a63d0b1cf17eff59da1176494a227c1fec839739dc78f7c210af3e
7
- data.tar.gz: 9e5a6c0b2c63ee555f002308f6c0763e1e261fb6dc7f21ff39a4742a5098243f784dd24eff519326b0e0be9ddfb29bcb07cf100a23c6e01c5d1dec99c286a786
6
+ metadata.gz: 10c8774cca0978d608873b3d88122d775d7fcac3a657e6931179de229d803f3dd3c72107e12b3445781ccc7fb395c9fce5120007e5e75ce3e64c48bba6687d78
7
+ data.tar.gz: a6aae5c4f55d97d2cb27df5d3f4622be6405c7cad65f078c94209aa858d3ec549ff8c8d77abbb51b22fc166823b5396618aa4d31db232420af0838c94fedc27e
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /vendor/
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], output: nil)
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
 
@@ -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 = "fluentd-tcp-capturer"
7
- spec.version = "0.1.2"
7
+ spec.version = "0.2.0"
8
8
  spec.authors = ["takumakanari"]
9
9
  spec.email = ["chemtrails.t@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd-tcp-capturer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - takumakanari