fluent-plugin-cloudwatch-transform 0.0.7 → 0.0.8
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/README.md +16 -7
- data/fluent-plugin-cloudwatch-transform.gemspec +3 -3
- data/lib/fluent/plugin/out_cloudwatch_transform.rb +16 -3
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aba5728971eeccf6c9a77e3cb514a6c4cad1148e
|
4
|
+
data.tar.gz: 7eeead8ab542b3cc56ca04fc2cf32953b42066ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81333d0f057d0dc351cadd85e0b710090d40d17895f618186f5e4a02c949e294953c5efac9636d47d2dc15385699d71770fbda948ff774b2fe30371d761934a
|
7
|
+
data.tar.gz: aa5259e9b655a3b8bb6ea2b776a4d02074b55b89e800edd0b85c977eea886d83de04160e30926ca31c7074d404efe4be8644d9efaccff3c3d6bce88703dca0a1
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@ fluent-plugin-cloudwatch-transform is an output plug-in for [Fluentd](http://flu
|
|
4
4
|
|
5
5
|
It can transform the alerts from fluent-plugin-cloudwatch to key-value pairs as "event_name" and "value",
|
6
6
|
also add more information from the tag you added in fluent-plugin-cloudwatch.
|
7
|
+
You can configure the position of these information in the tag, and also the name in the final output.
|
7
8
|
|
8
9
|
It also used "highwatermark" gem to store status timestamp to state file or redis cache
|
9
10
|
|
@@ -48,9 +49,10 @@ Add the following into your fluentd config.
|
|
48
49
|
|
49
50
|
<source>
|
50
51
|
type cloudwatch
|
51
|
-
tag #tag with
|
52
|
-
#
|
53
|
-
# for example: alert.cloudwatch.
|
52
|
+
tag #tag with some extra information that your want to put in th output after transform
|
53
|
+
# like region and availability zone, application name, wiki url in sequence
|
54
|
+
# for example: alert.raw.cloudwatch.region1-AZ1.Form & Printing Services (FPS)."http://runbook.wiki.com"
|
55
|
+
# the prefix alert.raw.cloudwatch is for the match, the rest is for the information
|
54
56
|
aws_key_id #your id
|
55
57
|
aws_sec_key #your key
|
56
58
|
cw_endpoint #your endpoint
|
@@ -61,15 +63,22 @@ Add the following into your fluentd config.
|
|
61
63
|
dimensions_value # dimensions value
|
62
64
|
</source>
|
63
65
|
|
64
|
-
<match alert.cloudwatch
|
66
|
+
<match alert.raw.cloudwatch.**>
|
65
67
|
type cloudwatch_transform
|
66
|
-
|
68
|
+
out_tag alert.processed.cloudwatch
|
67
69
|
state_type file #could be <redis/file/memory>
|
68
70
|
state_file /path/to/state/file/or/redis/conf # the file path for store state or the redis configure
|
69
|
-
|
71
|
+
state_tag cloudwatch
|
72
|
+
name_for_origin_key event_name
|
73
|
+
name_for_origin_value value
|
74
|
+
<tag_infos>
|
75
|
+
region_and_AZ 3
|
76
|
+
application_name 4
|
77
|
+
runbook 5
|
78
|
+
</tag_infos>
|
70
79
|
</match>
|
71
80
|
|
72
|
-
<match alert.cloudwatch
|
81
|
+
<match alert.processed.cloudwatch>
|
73
82
|
type stdout
|
74
83
|
</match>
|
75
84
|
|
@@ -3,8 +3,8 @@ $:.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-
|
6
|
+
gem.version = "0.0.8"
|
7
|
+
gem.date = '2015-05-06'
|
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 }
|
@@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_development_dependency 'bundler', '~> 1.3'
|
23
23
|
gem.add_development_dependency 'rake', '~> 0.9', '>= 0.9.2'
|
24
24
|
gem.add_development_dependency 'rspec', '~> 2.11', '>= 2.11.0'
|
25
|
-
gem.add_runtime_dependency "highwatermark", '~> 0.1'
|
25
|
+
gem.add_runtime_dependency "highwatermark", '~> 0.1', '>= 0.1.2'
|
26
26
|
end
|
@@ -5,9 +5,11 @@ module Fluent
|
|
5
5
|
Fluent::Plugin.register_output('cloudwatch_transform', self)
|
6
6
|
|
7
7
|
config_param :out_tag, :string
|
8
|
-
config_param :
|
8
|
+
config_param :state_tag, :string, :default => "cloudwatch"
|
9
|
+
config_param :state_type, :string, :default => "memory"
|
9
10
|
config_param :state_file, :string, :default => nil
|
10
|
-
config_param :
|
11
|
+
config_param :redis_host, :string, :default => nil
|
12
|
+
config_param :redis_port, :string, :default => nil
|
11
13
|
config_param :name_for_origin_key, :string, :default => nil
|
12
14
|
config_param :name_for_origin_value, :string, :default => nil
|
13
15
|
|
@@ -20,11 +22,22 @@ module Fluent
|
|
20
22
|
@tag_infos = Hash.new
|
21
23
|
conf.elements.select { |element| element.name == 'tag_infos' }.each { |element|
|
22
24
|
element.each_pair { |info_name, position_in_tag|
|
25
|
+
element.has_key?(info_name) # to suppress unread configuration warning
|
23
26
|
@tag_infos[info_name] = position_in_tag.to_i
|
24
27
|
$log.info "Added tag_infos: #{info_name}=>#{@tag_infos[info_name]}"
|
25
28
|
}
|
26
29
|
}
|
27
30
|
|
31
|
+
# configure for highwatermark
|
32
|
+
@highwatermark_parameters={
|
33
|
+
"state_tag" => @state_tag,
|
34
|
+
"state_type" => @state_type,
|
35
|
+
"state_file" => @state_file,
|
36
|
+
"redis_host" => @redis_host,
|
37
|
+
"redis_port" => @redis_port
|
38
|
+
}
|
39
|
+
$log.info "highwatermark_parameters: #{@highwatermark_parameters}"
|
40
|
+
|
28
41
|
end
|
29
42
|
|
30
43
|
def initialize
|
@@ -35,7 +48,7 @@ module Fluent
|
|
35
48
|
# This method is called when starting.
|
36
49
|
def start
|
37
50
|
super
|
38
|
-
@highwatermark = Highwatermark::HighWaterMark.new(@
|
51
|
+
@highwatermark = Highwatermark::HighWaterMark.new(@highwatermark_parameters)
|
39
52
|
|
40
53
|
end
|
41
54
|
|
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.8
|
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-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -91,6 +91,9 @@ dependencies:
|
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0.1'
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.1.2
|
94
97
|
type: :runtime
|
95
98
|
prerelease: false
|
96
99
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -98,6 +101,9 @@ dependencies:
|
|
98
101
|
- - ~>
|
99
102
|
- !ruby/object:Gem::Version
|
100
103
|
version: '0.1'
|
104
|
+
- - '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 0.1.2
|
101
107
|
description: FLuentd plugin for transform cloudwatch alerts
|
102
108
|
email:
|
103
109
|
- zhangling.ice@gmail.com
|