logstash-output-amazon_es 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa08a9c4871b87099540ea32d0483dc5139a1cf4
4
- data.tar.gz: 78aec4f345108386564cd42d66dad11c88ce8c6d
3
+ metadata.gz: b8e684954cb56d4dbe748aa75fa56b3e20e801e2
4
+ data.tar.gz: a7fbbfb68141369d2aed9cf1a01e6725f04f2cb9
5
5
  SHA512:
6
- metadata.gz: 35a4b6abc9a18a7140cbadefaeae8c9b641869621017ba310947573398f762c86b7ef02ace17cb52ec78dbba87985320141022bdb582b610942746ff85873970
7
- data.tar.gz: 283f9c8fc7b6302a41dc029c5a3815a8c7faa29eb2df17e8a447b56bfc808a250add140d8002cfcbe221219973d5930059d87b26c00bebad70beec10250a8a24
6
+ metadata.gz: bbeabd3a0c59f17c6764965d8554795b868d7c58c25765bee2b8a5af830bea887fba2aaf89235b651cf829f99b80f6e00b5fccbce7c57d5efbe59106589d1c1e
7
+ data.tar.gz: 6bb82fa2d3dea0bbb3d2dd61363012570f9f4a41186d5929d61f555ecf579dc6259e1a6152806194fff0c7064f061adbcae40fdb7a17f4c23d369990c77381cc
data/README.md CHANGED
@@ -27,7 +27,7 @@ An example configuration:
27
27
  amazon_es {
28
28
  hosts => ["foo.us-east-1.es.amazonaws.com"]
29
29
  region => "us-east-1"
30
- aws_access_key_id => 'ACCESS_KEY' (Will be made optional in next release to support instance profiles)
30
+ aws_access_key_id => 'ACCESS_KEY' (optional can use instance profiles as well)
31
31
  aws_secret_access_key => 'SECRET_KEY'
32
32
  index => "production-logs-%{+YYYY.MM.dd}"
33
33
  }
@@ -110,8 +110,8 @@ class LogStash::Outputs::AmazonES < LogStash::Outputs::Base
110
110
  #Signing specific details
111
111
  config :region, :validate => :string, :default => "us-east-1"
112
112
 
113
- # aws_access_key_id and aws_secret_access_key are currently needed for this plugin to work right.
114
- # Subsequent versions will have the credential resolution logic as follows:
113
+ # aws_access_key_id and aws_secret_access_key .
114
+ # credential resolution logic as follows:
115
115
  #
116
116
  # - User passed aws_access_key_id and aws_secret_access_key in aes configuration
117
117
  # - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
@@ -7,11 +7,11 @@ class AwsV4Signer < Faraday::Middleware
7
7
  def initialize(env)
8
8
  @env = env
9
9
  end
10
-
10
+
11
11
  def headers
12
12
  @env.request_headers
13
13
  end
14
-
14
+
15
15
  def set_header(header)
16
16
  @env.request_headers = header
17
17
  end
@@ -29,19 +29,23 @@ class AwsV4Signer < Faraday::Middleware
29
29
  end
30
30
  end
31
31
 
32
- def initialize(app, options = nil)
32
+ def signer
33
+ credentials = @options.fetch(:credentials)
34
+ service_name = @options.fetch(:service_name)
35
+ region = @options.fetch(:region)
36
+ Aws::Signers::V4.new(credentials, service_name, region)
37
+ end
38
+
39
+ def initialize(app, options = nil)
33
40
  super(app)
34
- credentials = options.fetch(:credentials)
35
- service_name = options.fetch(:service_name)
36
- region = options.fetch(:region)
37
- @signer = Aws::Signers::V4.new(credentials, service_name, region)
41
+ @options = options
38
42
  @net_http = app.is_a?(Faraday::Adapter::NetHttp)
39
43
  end
40
44
 
41
45
  def call(env)
42
46
  normalize_for_net_http!(env)
43
47
  req = Request.new(env)
44
- @signer.sign(req)
48
+ signer().sign(req)
45
49
  @app.call(env)
46
50
  end
47
51
 
@@ -55,4 +59,4 @@ class AwsV4Signer < Faraday::Middleware
55
59
 
56
60
  env.request_headers['Accept'] ||= '*/*'
57
61
  end
58
- end
62
+ end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-amazon_es'
4
- s.version = '0.1.1'
4
+ s.version = '0.1.2'
5
5
  s.licenses = ['apache-2.0']
6
6
  s.summary = "Logstash Output to Amazon Elasticsearch Service"
7
7
  s.description = "Output events to Amazon Elasticsearch Service with V4 signing"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-amazon_es
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby