fluent-plugin-output-solr 0.4.10 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/fluent-plugin-output-solr.gemspec +1 -1
- data/lib/fluent/plugin/out_solr.rb +21 -7
- 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: 6a4eb0134ff37a071cd0d2f146374558469fdf7f
|
4
|
+
data.tar.gz: d32077fbc8d29b01be5b38c84645da9fa7dbd945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 279793165b6c132e99ded418e4453c37025f9c796caa11ee6b59775681edb1196f17ce1a53684da842067c6f086b45c393591673b6faadec9de87b42255e119b
|
7
|
+
data.tar.gz: fbc1c4378f4d85146133971a99f9aa85b2b6cfab25c6998abc58f98907e2e1b85bd7c26283563e1e18eee09d5cf153f69d7044a6996410583b353aab9dd161de
|
data/README.md
CHANGED
@@ -104,12 +104,12 @@ The format of the time field (default %FT%TZ).
|
|
104
104
|
time_format %FT%TZ
|
105
105
|
```
|
106
106
|
|
107
|
-
###
|
107
|
+
### millisecond
|
108
108
|
|
109
|
-
|
109
|
+
Output millisecond to Solr (default false).
|
110
110
|
|
111
111
|
```
|
112
|
-
|
112
|
+
millisecond false
|
113
113
|
```
|
114
114
|
|
115
115
|
### flush_size
|
@@ -13,7 +13,7 @@ module Fluent
|
|
13
13
|
DEFAULT_TAG_FIELD = 'tag'
|
14
14
|
DEFAULT_TIME_FIELD = 'time'
|
15
15
|
DEFAULT_TIME_FORMAT = '%FT%TZ'
|
16
|
-
|
16
|
+
DEFAULT_MILLISECOND = false
|
17
17
|
DEFAULT_FLUSH_SIZE = 100
|
18
18
|
DEFAULT_COMMIT_WITH_FLUSH = true
|
19
19
|
|
@@ -49,8 +49,8 @@ module Fluent
|
|
49
49
|
:desc => 'A field name of event timestamp in the Solr schema.xml (default time).'
|
50
50
|
config_param :time_format, :string, :default => DEFAULT_TIME_FORMAT,
|
51
51
|
:desc => 'The format of the time field (default %d/%b/%Y:%H:%M:%S %z).'
|
52
|
-
config_param :
|
53
|
-
:desc => '
|
52
|
+
config_param :millisecond, :bool, :default => DEFAULT_MILLISECOND,
|
53
|
+
:desc => 'Output millisecond to Solr (default false).'
|
54
54
|
|
55
55
|
config_param :flush_size, :integer, :default => DEFAULT_FLUSH_SIZE,
|
56
56
|
:desc => 'A number of events to queue up before writing to Solr (default 100).'
|
@@ -117,13 +117,27 @@ module Fluent
|
|
117
117
|
|
118
118
|
if record.has_key?(@time_field) then
|
119
119
|
begin
|
120
|
-
|
121
|
-
|
120
|
+
tmp_time = Time.strptime(record[@time_field], @time_format)
|
121
|
+
if @millisecond then
|
122
|
+
record.merge!({@time_field => '%s.%03dZ' % [tmp_time.utc.strftime('%FT%T'), tmp_time.usec/ 1000.0]})
|
123
|
+
else
|
124
|
+
record.merge!({@time_field => tmp_time.utc.strftime('%FT%TZ')})
|
125
|
+
end
|
122
126
|
rescue
|
123
|
-
|
127
|
+
tmp_time = Time.at(time).utc
|
128
|
+
if @millisecond then
|
129
|
+
record.merge!({@time_field => '%s.%03dZ' % [tmp_time.utc.strftime('%FT%T'), tmp_time.usec/ 1000.0]})
|
130
|
+
else
|
131
|
+
record.merge!({@time_field => tmp_time.utc.strftime('%FT%TZ')})
|
132
|
+
end
|
124
133
|
end
|
125
134
|
else
|
126
|
-
|
135
|
+
tmp_time = Time.at(time).utc
|
136
|
+
if @millisecond then
|
137
|
+
record.merge!({@time_field => '%s.%03dZ' % [tmp_time.utc.strftime('%FT%T'), tmp_time.usec/ 1000.0]})
|
138
|
+
else
|
139
|
+
record.merge!({@time_field => tmp_time.utc.strftime('%FT%TZ')})
|
140
|
+
end
|
127
141
|
end
|
128
142
|
|
129
143
|
if @ignore_undefined_fields then
|
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.4.
|
4
|
+
version: 0.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minoru Osuka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|