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 +4 -4
- data/README.md +3 -0
- data/fluent-plugin-out-solr.gemspec +1 -1
- data/lib/fluent/plugin/out_solr.rb +11 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7916f0ec7e50455a7b9e11b836be309b9deffcad
|
4
|
+
data.tar.gz: 6d4b7033396e97c37b3c3005ad006b9cf7d98642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
|