logstash-input-elasticsearch 4.0.6 → 4.1.0

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: ba92d9cefd99749a5e35518dfda179e40c8f0e72
4
- data.tar.gz: 49948bf65f90442f72ea7cdaeaecb99682435361
3
+ metadata.gz: a7c2f2d4fa7bc002a154de1b2aa84bddc64312cf
4
+ data.tar.gz: e290171f93da3b6a970a5eb9bd6dc83102bdc667
5
5
  SHA512:
6
- metadata.gz: 07b74b7bb5a9ef500727d3749b47ef828ab835c694207943d84ec45728674cbc8872f26aa881d1542ddb0fe95fd0e3484a67eafb8ecf3872e4af0fffaa9f1871
7
- data.tar.gz: ddbb71da27fffaff23ee965da07136cc750172c6e0124db4b0464dd281d81e523deb542e2cc9f1fa9bdc64716494031db0869d3788a692cee7b8b19441fd47f0
6
+ metadata.gz: 0a47d63403a5f0934077a51c6e1d6e18acc62467ef8b8aefec94a3cc2f77db9f526f0c8551b0c32e41b1b235542c01e25e92f4a1cccf1a924095f7968f1a4469
7
+ data.tar.gz: 37669981d0014dbdd04606471fa563e4619d2dd586529c8e0e3daa4b618c14035cec018ab05fa614253880d1c3a179edf460221fcdf77d37884c5ad2969db825
@@ -1,3 +1,6 @@
1
+ ## 4.1.0
2
+ - Enable use of docinfo (@metadata) fields in `add_field` decorations
3
+
1
4
  ## 4.0.6
2
5
  - Docs: Fix link syntax
3
6
 
@@ -170,7 +170,6 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
170
170
 
171
171
  def push_hit(hit, output_queue)
172
172
  event = LogStash::Event.new(hit['_source'])
173
- decorate(event)
174
173
 
175
174
  if @docinfo
176
175
  # do not assume event[@docinfo_target] to be in-place updatable. first get it, update it, then at the end set it in the event.
@@ -190,6 +189,8 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
190
189
  event.set(@docinfo_target, docinfo_target)
191
190
  end
192
191
 
192
+ decorate(event)
193
+
193
194
  output_queue << event
194
195
  end
195
196
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-elasticsearch'
4
- s.version = '4.0.6'
4
+ s.version = '4.1.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Read from an Elasticsearch cluster, based on search query results"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -228,6 +228,27 @@ describe LogStash::Inputs::Elasticsearch do
228
228
  expect(event.get("[@metadata][_index]")).to eq('logstash-2014.10.12')
229
229
  expect(event.get("[@metadata][_id]")).to eq(nil)
230
230
  end
231
+
232
+ it 'should be able to reference metadata fields in `add_field` decorations' do
233
+ config = %q[
234
+ input {
235
+ elasticsearch {
236
+ hosts => ["localhost"]
237
+ query => '{ "query": { "match": { "city_name": "Okinawa" } }, "fields": ["message"] }'
238
+ docinfo => true
239
+ add_field => {
240
+ 'identifier' => "foo:%{[@metadata][_type]}:%{[@metadata][_id]}"
241
+ }
242
+ }
243
+ }
244
+ ]
245
+
246
+ event = input(config) do |pipeline, queue|
247
+ queue.pop
248
+ end
249
+
250
+ expect(event.get('identifier')).to eq('foo:logs:C5b2xLQwTZa76jBmHIbwHQ')
251
+ end
231
252
  end
232
253
 
233
254
  context "when not defining the docinfo" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.6
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-20 00:00:00.000000000 Z
11
+ date: 2017-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement