fluent-plugin-elb-log 1.0.0 → 1.0.1

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: 6d0a77ff70d99a0fc10f5ad9e6c15e19ccbdaaa7
4
- data.tar.gz: 27f55a2b2a64840d06d8650552f97a3e0747b1d6
3
+ metadata.gz: 73ccee68acfc7e347ceef8da49a04e1ae0068e75
4
+ data.tar.gz: 125177a377574bd78ec55e5c26ffc09b0fcab39c
5
5
  SHA512:
6
- metadata.gz: fba219878bc700649d697f13bcbca00d35c6845ab96eb1e41e8590bfd148e9af1c09fda1c712c97e276f7ea78ef732334979aed38cd54dcfaae85c2af5748307
7
- data.tar.gz: 6de037dd93c53636f0c9a53bb9184d8a797e62cd6854fbe7826ec082e7ab62fc5cdbffed4dc325cae1fcf1a645a60fa78364a98b8f708965cc4c0151b43fdb53
6
+ metadata.gz: b2b8ba564e4a19721fc5554a776353774fea70a9c943dd87f4c733501c3c200ebb041e7f7747dc8e92483fff04394e7bc7bd013b7b0574c495cbf7b1f1ba806a
7
+ data.tar.gz: 1624b3196b41d761918e8c2d2229493c76dc1fd4710a05c002ed93c8678fd355dd054a48f79f8e5ab3f1b3bd3f2850152ac1c8d3800947ae18eca2ee06e5f660
@@ -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-elb-log"
7
- spec.version = "1.0.0"
7
+ spec.version = "1.0.1"
8
8
  spec.authors = ["shinsaka"]
9
9
  spec.email = ["shinx1265@gmail.com"]
10
10
  spec.summary = "Amazon ELB log input plugin"
@@ -70,8 +70,8 @@ class Fluent::Plugin::Elb_LogInput < Fluent::Plugin::Input
70
70
  log.debug "timestamp file #{@timestamp_file} read"
71
71
  File.open(@timestamp_file, File::RDONLY) do |file|
72
72
  if file.size > 0
73
- timestamp_from_file = file.read.to_i
74
- if timestamp_from_file > timestamp
73
+ timestamp_from_file = file.read.to_i
74
+ if timestamp_from_file > timestamp
75
75
  timestamp = timestamp_from_file
76
76
  end
77
77
  end
@@ -196,7 +196,7 @@ class Fluent::Plugin::Elb_LogInput < Fluent::Plugin::Input
196
196
 
197
197
  object_key = content.key
198
198
  node_no = Digest::SHA1.hexdigest(object_key).to_i(16) % @num_nodes
199
- next unless node_no == @node_no
199
+ next unless node_no == @node_no
200
200
 
201
201
  matches = LOGFILE_REGEXP.match(object_key)
202
202
  if s3_last_modified_unixtime > timestamp and matches
@@ -286,7 +286,10 @@ class Fluent::Plugin::Elb_LogInput < Fluent::Plugin::Input
286
286
  next
287
287
  end
288
288
 
289
- router.emit(@tag, Time.parse(line_match[:time]), record_common.merge(format_record(line_match)))
289
+ now = Fluent::Engine.now
290
+ time = Time.parse(line_match[:time]).to_i rescue now
291
+
292
+ router.emit(@tag, time, record_common.merge(format_record(line_match)))
290
293
  end
291
294
  end
292
295
  rescue => e
@@ -320,4 +323,4 @@ class Fluent::Plugin::Elb_LogInput < Fluent::Plugin::Input
320
323
  "option3" => item[:option3]
321
324
  }
322
325
  end
323
- end
326
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-elb-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - shinsaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-28 00:00:00.000000000 Z
11
+ date: 2018-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd