fluent-plugin-output-solr 0.2.1 → 0.2.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 +8 -0
- data/fluent-plugin-output-solr.gemspec +1 -1
- data/lib/fluent/plugin/out_solr.rb +11 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51e820ac701e66673ab19adddf7d9757ee54c69e
|
4
|
+
data.tar.gz: fcd107f35414905f61c65b89fc72669b2ee4d1b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4bd3175277c9a5af0b8843be712896bcc4a588eebd8e9ad6c856fa0b88a24378c2874517b2cf23ce9cdd35f7c1f9289a478344dcf1d6f9b08eb88a6becde8a1
|
7
|
+
data.tar.gz: 3f6816f2c6f9b58973e7a34dd3e9512617d98c3902008ee799c183bfe99959a084883291b78dbd3412d32629ab1f9dd6b447c58d4bcedfea4f46a7628b879f2a
|
data/README.md
CHANGED
@@ -68,6 +68,14 @@ A field name of unique key in the Solr schema.xml. If omitted, it will get uniqu
|
|
68
68
|
unique_key_field id
|
69
69
|
```
|
70
70
|
|
71
|
+
### tag_field
|
72
|
+
|
73
|
+
A field name of fluentd tag in the Solr schema.xml (default tag).
|
74
|
+
|
75
|
+
```
|
76
|
+
tag_field tag
|
77
|
+
```
|
78
|
+
|
71
79
|
### timestamp_field
|
72
80
|
|
73
81
|
A field name of event timestamp in the Solr schema.xml (default event_timestamp).
|
@@ -9,6 +9,7 @@ module Fluent
|
|
9
9
|
|
10
10
|
DEFAULT_COLLECTION = 'collection1'
|
11
11
|
DEFAULT_IGNORE_UNDEFINED_FIELDS = false
|
12
|
+
DEFAULT_TAG_FIELD = 'tag'
|
12
13
|
DEFAULT_TIMESTAMP_FIELD = 'event_timestamp'
|
13
14
|
DEFAULT_FLUSH_SIZE = 100
|
14
15
|
|
@@ -36,6 +37,8 @@ module Fluent
|
|
36
37
|
|
37
38
|
config_param :unique_key_field, :string, :default => nil,
|
38
39
|
:desc => 'A field name of unique key in the Solr schema.xml. If omitted, it will get unique key via Solr Schema API.'
|
40
|
+
config_param :tag_field, :string, :default => DEFAULT_TAG_FIELD,
|
41
|
+
:desc => 'A field name of fluentd tag in the Solr schema.xml (default event_timestamp).'
|
39
42
|
config_param :timestamp_field, :string, :default => DEFAULT_TIMESTAMP_FIELD,
|
40
43
|
:desc => 'A field name of event timestamp in the Solr schema.xml (default event_timestamp).'
|
41
44
|
|
@@ -58,6 +61,7 @@ module Fluent
|
|
58
61
|
@ignore_undefined_field = conf.has_key?('ignore_undefined_field') ? conf['ignore_undefined_field'] : DEFAULT_IGNORE_UNDEFINED_FIELDS
|
59
62
|
|
60
63
|
@unique_key_field = conf['unique_key_field']
|
64
|
+
@tag_field = conf.has_key?('tag_field') ? conf['tag_field'] : DEFAULT_TAG_FIELD
|
61
65
|
@timestamp_field = conf.has_key?('timestamp_field') ? conf['timestamp_field'] : DEFAULT_TIMESTAMP_FIELD
|
62
66
|
|
63
67
|
@flush_size = conf.has_key?('flush_size') ? conf['flush_size'].to_i : DEFAULT_FLUSH_SIZE
|
@@ -104,12 +108,17 @@ module Fluent
|
|
104
108
|
@unique_key = @unique_key_field.nil? ? get_unique_key : @unique_key_field
|
105
109
|
|
106
110
|
chunk.msgpack_each do |tag, time, record|
|
107
|
-
|
108
111
|
unless record.has_key?(@unique_key) then
|
109
112
|
record.merge!({@unique_key => SecureRandom.uuid})
|
110
113
|
end
|
111
114
|
|
112
|
-
record.
|
115
|
+
unless record.has_key?(@tag_field) then
|
116
|
+
record.merge!({@tag_field => tag})
|
117
|
+
end
|
118
|
+
|
119
|
+
unless record.has_key?(@timestamp_field) then
|
120
|
+
record.merge!({@timestamp_field => Time.at(time).utc.strftime('%FT%TZ')})
|
121
|
+
end
|
113
122
|
|
114
123
|
if @ignore_undefined_fields then
|
115
124
|
record.each_key do |key|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-output-solr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minoru Osuka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|