fluent-plugin-cloudwatch-ingest 0.1.26 → 0.1.27
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 879138fd4fe1b464f782bb3b3f2258d0bd275da5
|
4
|
+
data.tar.gz: 8fca0c01fa6b7eeb7fb4133086c27e83e5361263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c21f3d0cffadb84cc9c2460eb8c3991be4ce1d05f42d393e700e34521a04f8dc164f34737113e4c31a559618afe8b2f275299238d6d228263a554af763048f9f
|
7
|
+
data.tar.gz: 607845f09ed67d73b6ccb367ffdb22ab91d50c25ce95f84fcdb0ff4cbca352268a7141c5aaad9aa9a49e3b40e6c679da8c6f0fb6015e7b3227fb8c732da9c408
|
@@ -1,7 +1,8 @@
|
|
1
|
+
require 'aws-sdk'
|
2
|
+
require 'fluent/config/error'
|
1
3
|
require 'fluent/plugin/input'
|
2
4
|
require 'fluent/plugin/parser'
|
3
|
-
require '
|
4
|
-
require 'aws-sdk'
|
5
|
+
require 'json'
|
5
6
|
require 'pathname'
|
6
7
|
require 'psych'
|
7
8
|
|
@@ -28,6 +29,8 @@ module Fluent::Plugin
|
|
28
29
|
config_param :interval, :time, default: 60
|
29
30
|
desc 'Time to pause between API call failures and limits'
|
30
31
|
config_param :api_interval, :time, default: 5
|
32
|
+
desc 'Tag to apply to record'
|
33
|
+
config_param :tag, :string, default: 'cloudwatch'
|
31
34
|
|
32
35
|
def initialize
|
33
36
|
super
|
@@ -71,8 +74,9 @@ module Fluent::Plugin
|
|
71
74
|
|
72
75
|
private
|
73
76
|
|
74
|
-
def emit(
|
75
|
-
|
77
|
+
def emit(event)
|
78
|
+
message = JSON.parse(event.message)
|
79
|
+
router.emit(@tag, event.timestamp / 1000, message)
|
76
80
|
end
|
77
81
|
|
78
82
|
def log_groups(log_group_prefix)
|
@@ -173,7 +177,7 @@ module Fluent::Plugin
|
|
173
177
|
next_token: stream_token
|
174
178
|
)
|
175
179
|
|
176
|
-
|
180
|
+
response.events.each { |e| emit(e) }
|
177
181
|
|
178
182
|
# Once all events for this stream have been processed,
|
179
183
|
# in this iteration, store the forward token
|