fluent-plugin-cloudwatch-ingest 0.1.28 → 0.1.29

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: e25c2bb33875775ad2e58170f40465b4f3afde9c
4
- data.tar.gz: fe06161ff38fd850d5e90992fd65ef3feaf23246
3
+ metadata.gz: eb42921ca68077f523331fc4aa6d81eb01f7dd91
4
+ data.tar.gz: bfc0061afb856ab4b05184633898b437fa8bc291
5
5
  SHA512:
6
- metadata.gz: f1b82ca1003b6074747b32a45f5e84cdcebcac0a37bde47f73cb346891ee83f5da7de5868d0e1ca5836bb5f38588a7c5b3bf0aeae4845495b0b577cc7a7c4150
7
- data.tar.gz: 60301d2a02e5782ce42fd1442d8d7e7304616d58a9c35e5cc377ca9e4ad1043b28fe16952ba5258bcd1d29e5c97960da4218b2b813c8890043392c03b0ebc914
6
+ metadata.gz: 64af3616a263fdc4d3524e67fb338ca8a91a666d279fa06ff91ca5129be5df2212fcfec003fad47c845561d215ec383dcbd63f858a18f77d0a2bedc3446fe28a
7
+ data.tar.gz: 597ddbcff66f381ea71a830b4db72fc1f5b3273385326c85abbdff612c6609abcef611f3d955f3eae62abff82fef952312e62115a7b5597fd4de0495313ba088
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Ingest
5
- VERSION = '0.1.28'.freeze
5
+ VERSION = '0.1.29'.freeze
6
6
  end
7
7
  end
8
8
  end
@@ -9,7 +9,7 @@ require 'psych'
9
9
  module Fluent::Plugin
10
10
  class CloudwatchIngestInput < Fluent::Plugin::Input
11
11
  Fluent::Plugin.register_input('cloudwatch_ingest', self)
12
- helpers :compat_parameters
12
+ helpers :compat_parameters, :parser
13
13
 
14
14
  desc 'The region of the source cloudwatch logs'
15
15
  config_param :region, :string, default: 'us-east-1'
@@ -39,10 +39,8 @@ module Fluent::Plugin
39
39
 
40
40
  def configure(conf)
41
41
  super
42
- if conf[:format]
43
- @parser = TextParser.new
44
- @parser.configure(conf)
45
- end
42
+ compat_parameters_convert(conf, :parser)
43
+ @parser = parser_create
46
44
  log.info('Configured fluentd-plugin-cloudwatch-ingest')
47
45
  end
48
46
 
@@ -79,13 +77,12 @@ module Fluent::Plugin
79
77
  private
80
78
 
81
79
  def emit(event)
82
- if @parser
83
- record = @parser.parse(event.message)
84
- router.emit(@tag, event.timestamp / 1000, record[1])
85
- else
86
- record = JSON.parse(event.message)
87
- router.emit(@tag, event.timestamp / 1000, record)
88
- end
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])
89
86
  end
90
87
 
91
88
  def log_groups(log_group_prefix)
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.28
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Pointer