fluent-plugin-cloudwatch-ingest 0.1.29 → 0.1.30

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb42921ca68077f523331fc4aa6d81eb01f7dd91
4
- data.tar.gz: bfc0061afb856ab4b05184633898b437fa8bc291
3
+ metadata.gz: cc1cb33ddb43fb7783d1367e8b2f2852fa0109b3
4
+ data.tar.gz: 2d906137dc4a11f76ff82ea3fd3406baa6e08f8f
5
5
  SHA512:
6
- metadata.gz: 64af3616a263fdc4d3524e67fb338ca8a91a666d279fa06ff91ca5129be5df2212fcfec003fad47c845561d215ec383dcbd63f858a18f77d0a2bedc3446fe28a
7
- data.tar.gz: 597ddbcff66f381ea71a830b4db72fc1f5b3273385326c85abbdff612c6609abcef611f3d955f3eae62abff82fef952312e62115a7b5597fd4de0495313ba088
6
+ metadata.gz: 064cbdc71f55a6c3d7fc6febc34a35706950c27e84d0f53ffa7edb21ab5ac118a6a4c7b4c904a92e8b868cde0a694ce4f5e49532ac0d757b19b799ff1fa4b24b
7
+ data.tar.gz: 5b66f9eecb23c439328b085a6dbe51bc00f65129aa5991c44b606e6bb9fb8d290b807f484fb78a449e3fa800a20020238b619a4d2a0984c4a13cc3c2c18d7062
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Ingest
5
- VERSION = '0.1.29'.freeze
5
+ VERSION = '0.1.30'.freeze
6
6
  end
7
7
  end
8
8
  end
@@ -78,11 +78,7 @@ module Fluent::Plugin
78
78
 
79
79
  def emit(event)
80
80
  time, record = @parser.parse(event.message)
81
- unless time # If the time isn't parsed from
82
- time = event.time / 1000 # the record then take it from
83
- end # the Cloudwatch event timestamp
84
-
85
- router.emit(@tag, time, record[1])
81
+ router.emit(@tag, time, record)
86
82
  end
87
83
 
88
84
  def log_groups(log_group_prefix)
@@ -0,0 +1,34 @@
1
+ require 'fluent/plugin/parser_regexp'
2
+ require 'fluent/time'
3
+
4
+ module Fluent
5
+ module Plugin
6
+ class CloudwatchIngestParser < RegexpParser
7
+ Plugin.register_parser('cloudwatch_ingest', self)
8
+
9
+ config_set_default :expression, '/(?<message>.+)'
10
+ config_set_default :time_format, '%Y-%m-%d %H:%M:%S.%L'
11
+
12
+ def parse(event)
13
+ time = nil
14
+ record = nil
15
+ super(event.message) do |t, r|
16
+ time = t
17
+ record = r
18
+ end
19
+
20
+ # We do String processing on the event time here to
21
+ # avoid rounding errors introduced by floating point
22
+ # arithmetic.
23
+ event_s = event.timestamp.to_s[0..9]
24
+ event_ns = event.timestamp.to_s[10..-1].to_i * 1_000_000
25
+
26
+ # If we cannot parse the time from the message itself (either because
27
+ # a time field is not included in the format, or it is not matched)
28
+ # then we take the time from the cloudwatch event time
29
+ time = time ? time : Fluent::EventTime.new(event_s, event_ns)
30
+ yield time, record
31
+ end
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch-ingest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Pointer
@@ -118,6 +118,7 @@ files:
118
118
  - lib/fluent/plugin/cloudwatch/ingest.rb
119
119
  - lib/fluent/plugin/cloudwatch/ingest/version.rb
120
120
  - lib/fluent/plugin/in_cloudwatch_ingest.rb
121
+ - lib/fluent/plugin/parser_cloudwatch_ingest.rb
121
122
  homepage: https://github.com/sampointer/fluent-plugin-cloudwatch-ingest
122
123
  licenses: []
123
124
  metadata: