logstash-output-elasticsearch 10.6.2-java → 10.7.0-java

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
  SHA256:
3
- metadata.gz: c2b97b57f05641257d4d82abf2ffc924252385a2376e80ed760bef849d5d2699
4
- data.tar.gz: e4fd909cb0fbe096ff54abc0f77c013e601c7a4c01e3ba3bc72a7e121739a80e
3
+ metadata.gz: 311303e9bfc0369329af5ec4da290d92e428bddee2e022fb1f22967fb1f1d6d9
4
+ data.tar.gz: c88b0816b49bd5f5ab232156340f946b674e70a62b86f8a1c4c25ed985840c6e
5
5
  SHA512:
6
- metadata.gz: a17060e61a967293beda8046c0bc03d8583049509f0434c07c6024873b166a6cc2a011a6fa6293daee18f7fef6b6ca5f562e37c61f3150684ac88e58a397384b
7
- data.tar.gz: f9f660a1b5d5eecb4a80dcafbd52872b34b4491a3d3b62e57d3710961c771488368960ec1662c5c2503de1ce2da45fc2b39f0900f407ed8f304b28539c291c26
6
+ metadata.gz: 7d9910d4f28a864ac45450cd2be179268d8b83c91f8dab57328e6c772b06a39d7d8aa3fa7c34cddcd45a185bc994da2f2b46ee3b29bf2dc219a3189b6e995b30
7
+ data.tar.gz: de41059508b3f06466446d3a183d4959cdaaacffb00492d917acc57824b4864a694c5834c8e210d8d277ae186c146d6bf3c6b9ab0c0cd1ab73bc7f95a6f4e871
@@ -1,3 +1,6 @@
1
+ ## 10.7.0
2
+ - Changed: don't set the pipeline parameter if the value resolves to an empty string [#962](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/962)
3
+
1
4
  ## 10.6.2
2
5
  - [DOC] Added clarifying info on http compression settings and behaviors [#943](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/943)
3
6
  - [DOC] Fixed entry for ilm_policy default value[#956](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/956)
@@ -647,8 +647,8 @@ not also set this field. That will raise an error at startup
647
647
  * Value type is <<string,string>>
648
648
  * Default value is `nil`
649
649
 
650
- Set which ingest pipeline you wish to execute for an event. You can also use event dependent configuration
651
- here like `pipeline => "%{INGEST_PIPELINE}"`
650
+ Set which ingest pipeline you wish to execute for an event. You can also use event dependent configuration here
651
+ like `pipeline => "%{[@metadata][pipeline]}"`. The pipeline parameter won't be set if the value resolves to empty string ("").
652
652
 
653
653
  [id="plugins-{type}s-{plugin}-pool_max"]
654
654
  ===== `pool_max`
@@ -84,7 +84,13 @@ module LogStash; module Outputs; class ElasticSearch;
84
84
  params[:_type] = get_event_type(event) if use_event_type?(nil)
85
85
 
86
86
  if @pipeline
87
- params[:pipeline] = event.sprintf(@pipeline)
87
+ value = event.sprintf(@pipeline)
88
+ # convention: empty string equates to not using a pipeline
89
+ # this is useful when using a field reference in the pipeline setting, e.g.
90
+ # elasticsearch {
91
+ # pipeline => "%{[@metadata][pipeline]}"
92
+ # }
93
+ params[:pipeline] = value unless value.empty?
88
94
  end
89
95
 
90
96
  if @parent
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '10.6.2'
3
+ s.version = '10.7.0'
4
4
 
5
5
  s.licenses = ['apache-2.0']
6
6
  s.summary = "Stores logs in Elasticsearch"
@@ -355,6 +355,28 @@ describe LogStash::Outputs::ElasticSearch do
355
355
  end
356
356
  end
357
357
 
358
+ describe "the pipeline option" do
359
+ context "with a sprintf and set pipeline" do
360
+ let(:options) { {"pipeline" => "%{pipeline}" } }
361
+
362
+ let(:event) { LogStash::Event.new("pipeline" => "my-ingest-pipeline") }
363
+
364
+ it "should interpolate the pipeline value and set it" do
365
+ expect(subject.event_action_tuple(event)[1]).to include(:pipeline => "my-ingest-pipeline")
366
+ end
367
+ end
368
+
369
+ context "with a sprintf and empty pipeline" do
370
+ let(:options) { {"pipeline" => "%{pipeline}" } }
371
+
372
+ let(:event) { LogStash::Event.new("pipeline" => "") }
373
+
374
+ it "should interpolate the pipeline value but not set it because it is empty" do
375
+ expect(subject.event_action_tuple(event)[1]).not_to include(:pipeline)
376
+ end
377
+ end
378
+ end
379
+
358
380
  describe "SSL end to end" do
359
381
  let(:do_register) { false } # skip the register in the global before block, as is called here.
360
382
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.2
4
+ version: 10.7.0
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-04 00:00:00.000000000 Z
11
+ date: 2020-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement