fluent-plugin-cloudwatch-ingest-chaeyk 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.rubocop.yml +20 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE +674 -0
- data/README.md +132 -0
- data/Rakefile +8 -0
- data/assets/credentials +2 -0
- data/bin/console +14 -0
- data/bin/deploy +10 -0
- data/bin/setup +7 -0
- data/circle.yml +11 -0
- data/fluent-plugin-cloudwatch-ingest.gemspec +37 -0
- data/lib/fluent/plugin/cloudwatch/ingest.rb +9 -0
- data/lib/fluent/plugin/cloudwatch/ingest/version.rb +9 -0
- data/lib/fluent/plugin/in_cloudwatch_ingest.rb +299 -0
- data/lib/fluent/plugin/parser_cloudwatch_ingest.rb +47 -0
- metadata +146 -0
@@ -0,0 +1,47 @@
|
|
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_param :expression, :string, default: '^(?<message>.+)$'
|
10
|
+
config_param :time_format, :string, default: '%Y-%m-%d %H:%M:%S.%L'
|
11
|
+
config_param :event_time, :bool, default: true
|
12
|
+
config_param :inject_group_name, :bool, default: true
|
13
|
+
config_param :inject_stream_name, :bool, default: true
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def configure(conf)
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
23
|
+
def parse(event, group, stream)
|
24
|
+
time = nil
|
25
|
+
record = nil
|
26
|
+
super(event.message) do |t, r|
|
27
|
+
time = t
|
28
|
+
record = r
|
29
|
+
end
|
30
|
+
|
31
|
+
# Inject optional fields
|
32
|
+
record['log_group_name'] = group if @inject_group_name
|
33
|
+
record['log_stream_name'] = stream if @inject_stream_name
|
34
|
+
|
35
|
+
# We do String processing on the event time here to
|
36
|
+
# avoid rounding errors introduced by floating point
|
37
|
+
# arithmetic.
|
38
|
+
event_s = event.timestamp.to_s[0..9].to_i
|
39
|
+
event_ns = event.timestamp.to_s[10..-1].to_i * 1_000_000
|
40
|
+
|
41
|
+
time = Fluent::EventTime.new(event_s, event_ns) if @event_time
|
42
|
+
|
43
|
+
yield time, record
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-cloudwatch-ingest-chaeyk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sam Pointer
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-05-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fluentd
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.14.13
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.14.13
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: aws-sdk
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.8.4
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.8.4
|
97
|
+
description: Fluentd plugin to ingest AWS Cloudwatch logs
|
98
|
+
email:
|
99
|
+
- san@outsidethe.net
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".rubocop.yml"
|
107
|
+
- ".ruby-version"
|
108
|
+
- Gemfile
|
109
|
+
- LICENSE
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- assets/credentials
|
113
|
+
- bin/console
|
114
|
+
- bin/deploy
|
115
|
+
- bin/setup
|
116
|
+
- circle.yml
|
117
|
+
- fluent-plugin-cloudwatch-ingest.gemspec
|
118
|
+
- lib/fluent/plugin/cloudwatch/ingest.rb
|
119
|
+
- lib/fluent/plugin/cloudwatch/ingest/version.rb
|
120
|
+
- lib/fluent/plugin/in_cloudwatch_ingest.rb
|
121
|
+
- lib/fluent/plugin/parser_cloudwatch_ingest.rb
|
122
|
+
homepage: https://github.com/sampointer/fluent-plugin-cloudwatch-ingest
|
123
|
+
licenses: []
|
124
|
+
metadata:
|
125
|
+
allowed_push_host: https://rubygems.org
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options: []
|
128
|
+
require_paths:
|
129
|
+
- lib
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
requirements: []
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 2.5.1
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Fluentd plugin to ingest AWS Cloudwatch logs
|
146
|
+
test_files: []
|