fluent-plugin-sqs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS ADDED
@@ -0,0 +1 @@
1
+ Yudai Odagiri <ixixizko _at_ gmail.com>
data/README.rdoc ADDED
@@ -0,0 +1,40 @@
1
+ = Amazon SQS output plugin for Fluent
2
+
3
+ == Install
4
+ $ gem install fluent-plugin-sqs
5
+
6
+ == Component
7
+
8
+ === SQSOutput
9
+
10
+ Store fluent-event as queue message to amazon SQS.
11
+
12
+ == Configuratin
13
+
14
+ === SQSOutput
15
+
16
+ <match sqs.**>
17
+
18
+ type sqs
19
+
20
+ # following attibutes are required
21
+
22
+ aws_key_id {your_aws_key_id}
23
+ aws_sec_key {your_aws_secret_key}
24
+  queue_instance_key {queue_instance_key}
25
+
26
+ # following attibutes are optional
27
+
28
+ </match>
29
+
30
+ == TODO
31
+ - implement!
32
+
33
+ === More configuration
34
+
35
+ == Tool
36
+
37
+ == Copyright
38
+
39
+ Copyright:: Copyright (c) 2011- Yudai Odagiri
40
+ License:: Apache License, Version 2.0
data/Rakefile ADDED
@@ -0,0 +1,31 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/clean'
4
+
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gemspec|
8
+ gemspec.name = "fluent-plugin-sqs"
9
+ gemspec.summary = "Amazon SQS output plugin for Fluent event collector"
10
+ gemspec.author = "Yudai Odagiri"
11
+ gemspec.email = "ixixizko@gmail.com"
12
+ gemspec.homepage = "http://github.com/fluent"
13
+ gemspec.has_rdoc = false
14
+ gemspec.require_paths = ["lib"]
15
+ gemspec.add_dependency "fluentd", "~> 0.10.0"
16
+ gemspec.test_files = Dir["test/**/*.rb"]
17
+ gemspec.files = Dir["lib/**/*", "test/**/*.rb"] + %w[VERSION AUTHORS Rakefile]
18
+ gemspec.executables = []
19
+ end
20
+ Jeweler::GemcutterTasks.new
21
+ rescue LoadError
22
+ puts "Jeweler not available. Install it with: gem install jeweler"
23
+ end
24
+
25
+ Rake::TestTask.new(:test) do |t|
26
+ t.test_files = Dir['test/*_test.rb']
27
+ t.ruby_opts = ['-rubygems'] if defined? Gem
28
+ t.ruby_opts << '-I.'
29
+ end
30
+
31
+ task :default => [:build]
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,46 @@
1
+ module Fluent
2
+
3
+ require 'aws-sdk'
4
+
5
+ class SQSOutput < Output
6
+
7
+ Fluent::Plugin.register_output('sqs', self)
8
+
9
+ include SetTagKeyMixin
10
+ config_set_default :include_tag_key, false
11
+
12
+ include SetTimeKeyMixin
13
+ config_set_default :include_time_key, true
14
+
15
+ config_param :aws_key_id, :string
16
+ config_param :aws_sec_key, :string
17
+ config_param :queue_name, :string
18
+
19
+
20
+ def configure(conf)
21
+ super
22
+ end
23
+
24
+ def start
25
+ super
26
+ @sqs = AWS::SQS.new(
27
+ :access_key_id => @aws_key_id,
28
+ :secret_access_key => @aws_sec_key )
29
+ @queue = @sqs.queues.create(@queue_name)
30
+ end
31
+
32
+ def shutdown
33
+ super
34
+ end
35
+
36
+ def emit(tag, es, chain)
37
+ es.each {|time,record|
38
+ record["time"] = Time.at(time).localtime
39
+ msg = @queue.send_message(record.to_json)
40
+ $stderr.puts "sent message: #{msg.id}"
41
+ }
42
+ chain.next
43
+ end
44
+
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fluent-plugin-sqs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Yudai Odagiri
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-10-17 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: fluentd
16
+ requirement: &70105958990720 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.10.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70105958990720
25
+ description:
26
+ email: ixixizko@gmail.com
27
+ executables: []
28
+ extensions: []
29
+ extra_rdoc_files:
30
+ - README.rdoc
31
+ files:
32
+ - AUTHORS
33
+ - Rakefile
34
+ - VERSION
35
+ - lib/fluent/plugin/out_sqs.rb
36
+ - README.rdoc
37
+ homepage: http://github.com/fluent
38
+ licenses: []
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubyforge_project:
57
+ rubygems_version: 1.8.7
58
+ signing_key:
59
+ specification_version: 3
60
+ summary: Amazon SQS output plugin for Fluent event collector
61
+ test_files: []