fluent-plugin-out-solr 0.0.1 → 0.0.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: bc782b093daee34447a02fd38a5329ea324b5451
4
- data.tar.gz: f9d6ed5c4ee8e56adf8bbda753cbf099a02d9eda
3
+ metadata.gz: 7916f0ec7e50455a7b9e11b836be309b9deffcad
4
+ data.tar.gz: 6d4b7033396e97c37b3c3005ad006b9cf7d98642
5
5
  SHA512:
6
- metadata.gz: 1c6087383a13c05b88f30e4d14553e17852cce81bd3181b958a3329354d59328fd253527a4281b54d9d3506c74725aa88e44498af7aa5fe87e5059a21c8fd765
7
- data.tar.gz: 0a5ef15f05a429891962cd8661b3507ccab8c911638b1d2eec38e80da1b21bd8435099dedc16c20c37b7193fdd5e46485ea780710081e5ac7802133addc38a0f
6
+ metadata.gz: bb946c862e75c7c45fc4dbeef7287f14e258e4c9b891cdc2a5a538530fa92d9801819722f3b2204eef5fbb1fed72c70fbc38f8af47467815fbc971b18f11aee2
7
+ data.tar.gz: 053c03470d2ba1e7cf52739a33606b62ca0b897e6592553325bbc08b5898ad437daf5812b9d9b1ccfd5ab931aab6f8505413851ff402c80e34105cc17eff137a
data/README.md CHANGED
@@ -27,6 +27,7 @@ Notice: no relationship with [btigit/fluent-plugin-solr](https://github.com/btig
27
27
  core collection1
28
28
  include_tag_key true
29
29
  tag_key tag
30
+ use_utc false
30
31
  flush_interval 3s
31
32
  </match>
32
33
  ```
@@ -64,6 +65,8 @@ See: [UniqueKey - Solr Wiki](https://wiki.apache.org/solr/UniqueKey)
64
65
  <field name="referer" type="string" indexed="true" stored="true"/>
65
66
  <field name="agent" type="text_ws" indexed="true" stored="true"/>
66
67
  <field name="tag" type="string" indexed="true" stored="true"/>
68
+
69
+ <field name="timestamp" type="tdate" indexed="true" stored="true"/>
67
70
  ```
68
71
 
69
72
  ## Contributing
@@ -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-out-solr'
6
- s.version = '0.0.1'
6
+ s.version = '0.0.2'
7
7
  s.authors = ['diogo', 'pitr', 'haruyama']
8
8
  s.email = ['team@uken.com', 'haruyama@unixuser.org']
9
9
  s.description = %q{Solr output plugin for Fluent event collector}
@@ -9,6 +9,8 @@ class Fluent::SolrOutput < Fluent::BufferedOutput
9
9
  config_param :host, :string, default: 'localhost'
10
10
  config_param :port, :integer, default: 8983
11
11
  config_param :core, :string, default: 'collection1'
12
+ config_param :time_field, :string, default: 'timestamp'
13
+ config_param :use_utc, :bool, default: false
12
14
 
13
15
  include Fluent::SetTagKeyMixin
14
16
  config_set_default :include_tag_key, false
@@ -37,8 +39,16 @@ class Fluent::SolrOutput < Fluent::BufferedOutput
37
39
  bulk_message = []
38
40
 
39
41
  chunk.msgpack_each do |tag, time, record|
40
- record.merge!(@tag_key => tag) if @include_tag_key
41
42
 
43
+ time_string =
44
+ if @use_utc
45
+ Time.at(time).utc.strftime('%FT%TZ')
46
+ else
47
+ Time.at(time).strftime('%FT%TZ')
48
+ end
49
+
50
+ record.merge!(@time_field => time_string)
51
+ record.merge!(@tag_key => tag) if @include_tag_key
42
52
  bulk_message << record
43
53
  end
44
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-out-solr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - diogo