fluent-plugin-cloudwatch-transform 0.0.3 → 0.0.4
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 +4 -4
- data/.DS_Store +0 -0
- data/fluent-plugin-cloudwatch-transform.gemspec +3 -3
- data/lib/fluent/plugin/out_cloudwatch_transform.rb +10 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd04f4ba0fff4e3fe7723aae95ac042e1e6d1947
|
4
|
+
data.tar.gz: d7147b9d1f1de9c84b86ffe2fb596027e476ab59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12fe4bc88da9697f3a395cdf1ed5bc98f84fe3e09b356e7d9249bb6134c2babec85c83e958122b8bcb8f5dcc2f97c50ca6f70dbc73bbd235d750eb1aa397e8f8
|
7
|
+
data.tar.gz: bb90d407337f5d4d861930b3c030d0ae873d4ae1469440fa21ea1defe89426853dd43faa1f33696e5748b2c12d2cffe6827147e86651ed8efdca7111f622bc51
|
data/.DS_Store
CHANGED
Binary file
|
@@ -3,12 +3,12 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "fluent-plugin-cloudwatch-transform"
|
6
|
-
gem.version = "0.0.
|
7
|
-
gem.date = '2015-03-
|
6
|
+
gem.version = "0.0.4"
|
7
|
+
gem.date = '2015-03-26'
|
8
8
|
gem.authors = ["Ling Zhang"]
|
9
9
|
gem.email = ["zhangling.ice@gmail.com"]
|
10
10
|
gem.summary = %q{Fluentd output plugin for transform cloudwatch alerts }
|
11
|
-
gem.description = %q{FLuentd plugin for transform cloudwatch alerts
|
11
|
+
gem.description = %q{FLuentd plugin for transform cloudwatch alerts}
|
12
12
|
gem.homepage = 'https://github.com/lingzhang-lyon/fluent-plugin-cloudwatch-transform'
|
13
13
|
gem.license = 'MIT'
|
14
14
|
|
@@ -30,8 +30,13 @@ module Fluent
|
|
30
30
|
#
|
31
31
|
# NOTE! This method is called by Fluentd's main thread so you should not write slow routine here. It causes Fluentd's performance degression.
|
32
32
|
def emit(tag, es, chain)
|
33
|
-
tag_parts = tag.split('.')
|
34
|
-
|
33
|
+
#tag_parts = tag.split('.')
|
34
|
+
tag_parts = tag.scan( /([^".]+)|"([^"]+)"/ ).flatten.compact
|
35
|
+
# the prefix of tag should be like alert.cloudwatch.raw.***
|
36
|
+
# so start from tag_parts[3]
|
37
|
+
regionAZ = tag_parts[3]
|
38
|
+
application_name = tag_parts[4]
|
39
|
+
runbook_url = tag_parts[5]
|
35
40
|
chain.next
|
36
41
|
es.each {|time,record|
|
37
42
|
|
@@ -45,8 +50,9 @@ module Fluent
|
|
45
50
|
# add more information for the cloudwatch alert
|
46
51
|
timestamp = Engine.now # Should be receive_time_input
|
47
52
|
newhash["receive_time_input"]=timestamp.to_s
|
48
|
-
newhash["application_name"] =
|
49
|
-
newhash["intermediary_source"] =
|
53
|
+
newhash["application_name"] = application_name
|
54
|
+
newhash["intermediary_source"] = regionAZ
|
55
|
+
newhash["runbook"] = runbook_url
|
50
56
|
newhash["event_type"] = "alert.cloudwatch"
|
51
57
|
|
52
58
|
#log the transformed message and emit it
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-cloudwatch-transform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ling Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -84,7 +84,7 @@ dependencies:
|
|
84
84
|
- - '>='
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: 2.11.0
|
87
|
-
description: FLuentd plugin for transform cloudwatch alerts
|
87
|
+
description: FLuentd plugin for transform cloudwatch alerts
|
88
88
|
email:
|
89
89
|
- zhangling.ice@gmail.com
|
90
90
|
executables: []
|