fluent-plugin-logentries 0.0.4 → 0.0.5

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: a5f759b0770dd1199f13f790a4126cc58122da38
4
- data.tar.gz: aa0ae2f4c53dcff7689f088740a8dc20f8398e64
3
+ metadata.gz: ee209ea1b376b29613b32d17b8a528677eafccd7
4
+ data.tar.gz: 733ec7a1db5b79bf75637b40660fa308c3adfd63
5
5
  SHA512:
6
- metadata.gz: 7ed23880d05afe47319e0efb17c75b4056402deb337d7c6be210692a97a06a9fcdaf01dbf7b1fac90be0f28c6131001d5a55d3fb11fdb319769b60b5d3c811cc
7
- data.tar.gz: 01f32fef24d176376ab066149f7ceaae00829ee60fa0ffa686693b61fe2718354363af32fc01f23f83a2c4bdddf7c0ebf8c5a77016198f84574b9a001b9eb56c
6
+ metadata.gz: 197ef512ef1100dcdc3840de52aa5056df4cd2658e5514ff5f19d63a881bb059c6d0f84f8480f1e7eeea06dc2c5a7a477a090ff804e435e2821f688c8bb10c12
7
+ data.tar.gz: 14ffdbc3a0b3e246f2387287aabd2f657bf568768c128977de4b856ae095a4760fbb1c89948f17cb5a0455ee32db8fa15d50e93210d8695a84eae9c8768f85cb
@@ -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-logentries"
7
- spec.version = "0.0.4"
7
+ spec.version = "0.0.5"
8
8
  spec.authors = ["Woorank"]
9
9
  spec.email = ["dev@woorank.com"]
10
10
  spec.summary = "Logentries output plugin for Fluent event collector"
@@ -11,10 +11,11 @@ class LogentriesOutput < Fluent::BufferedOutput
11
11
  config_param :path, :string
12
12
 
13
13
  def configure(conf)
14
- super
15
14
  @port = conf['port']
16
15
  @host = conf['host']
17
16
  @path = conf['path']
17
+
18
+ super
18
19
  end
19
20
 
20
21
  def start
@@ -22,9 +23,9 @@ class LogentriesOutput < Fluent::BufferedOutput
22
23
  end
23
24
 
24
25
  def shutdown
25
- super
26
-
27
26
  client.close
27
+
28
+ super
28
29
  end
29
30
 
30
31
  def client
@@ -36,13 +37,14 @@ class LogentriesOutput < Fluent::BufferedOutput
36
37
  return [tag, record].to_msgpack
37
38
  end
38
39
 
39
- # Scan a given directory for host tokens
40
+ # Scan a given directory for logentries tokens
40
41
  def generate_token(path)
41
42
  tokens = {}
42
43
 
43
44
  Dir[path << "*.token"].each do |file|
44
45
  key = File.basename(file, ".token") #remove path/extension from filename
45
- tokens[key] = File.open(file, &:readline).gsub(/\r\n|\r|\n/, '') #read the first line and close it
46
+ #read the first line, remove unwanted char and close it
47
+ tokens[key] = File.open(file, &:readline).gsub(/\r\n|\r|\n/, '')
46
48
  end
47
49
  tokens
48
50
  end
@@ -69,12 +71,12 @@ class LogentriesOutput < Fluent::BufferedOutput
69
71
  next if token.nil?
70
72
 
71
73
  if record.has_key?("message")
72
- send(record["message"] << ' ' << token)
74
+ send_logentries(record["message"] + ' ' + token)
73
75
  end
74
76
  end
75
77
  end
76
78
 
77
- def send(data)
79
+ def send_logentries(data)
78
80
  retries = 0
79
81
  begin
80
82
  client.puts data
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-logentries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Woorank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-24 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler