fluent-plugin-elasticsearch 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in fluent-plugin-elasticsearch.gemspec
4
4
  gemspec
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 TODO: Write your name
1
+ Copyright (c) 2012 Uken Games
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -14,7 +14,7 @@ In your fluentd configration, use `type elasticsearch`. Additional configuration
14
14
  host localhost
15
15
  port 9200
16
16
  index_name fluentd
17
- index_type fluentd
17
+ type_name fluentd
18
18
  ```
19
19
 
20
20
 
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-elasticsearch"
6
- s.version = '0.1.0'
6
+ s.version = '0.1.1'
7
7
  s.authors = ["diogo"]
8
8
  s.email = ["team@uken.com"]
9
9
  s.description = %q{ElasticSearch output plugin for Fluent event collector}
@@ -40,7 +40,7 @@ class Fluent::ElasticsearchOutput < Fluent::BufferedOutput
40
40
  chunk.msgpack_each do |tag, time, record|
41
41
  if @logstash_format
42
42
  record.merge!({"@timestamp" => Time.at(time).to_datetime.to_s})
43
- target_index = "logstash-#{Time.now.strftime("%Y.%m.%d")}"
43
+ target_index = "logstash-#{Time.at(time).getutc.strftime("%Y.%m.%d")}"
44
44
  else
45
45
  target_index = @index_name
46
46
  end
@@ -0,0 +1 @@
1
+ require 'minitest/pride'
@@ -6,6 +6,8 @@ require 'fluent/plugin/out_elasticsearch'
6
6
  require 'webmock/test_unit'
7
7
  require 'date'
8
8
 
9
+ require 'helper'
10
+
9
11
  $:.push File.expand_path("../lib", __FILE__)
10
12
  $:.push File.dirname(__FILE__)
11
13
 
@@ -98,9 +100,10 @@ class ElasticsearchOutput < Test::Unit::TestCase
98
100
 
99
101
  def test_writes_to_logstash_index
100
102
  driver.configure("logstash_format true\n")
101
- logstash_index = "logstash-#{Time.now.strftime("%Y.%m.%d")}"
103
+ time = Time.parse Date.today.to_s
104
+ logstash_index = "logstash-#{time.getutc.strftime("%Y.%m.%d")}"
102
105
  stub_elastic
103
- driver.emit(sample_record)
106
+ driver.emit(sample_record, time)
104
107
  driver.run
105
108
  assert_equal(logstash_index, index_cmds.first['index']['_index'])
106
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-13 00:00:00.000000000 Z
12
+ date: 2013-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  segments:
91
91
  - 0
92
- hash: -3051582702752188354
92
+ hash: 4483254378511463978
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  segments:
100
100
  - 0
101
- hash: -3051582702752188354
101
+ hash: 4483254378511463978
102
102
  requirements: []
103
103
  rubyforge_project:
104
104
  rubygems_version: 1.8.23