logstash-output-elasticsearch 10.2.2-java → 10.2.3-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: cee8d8a64a98ebc0e90746c1e84323fbe842ae0afdbf072e530b50cbb4b27950
4
- data.tar.gz: 2b24860b48ef18b5c28cfc9b62990ecc90bd202269b309b681181e0c18b9bae6
3
+ metadata.gz: 6be61b215a17faa3cec976576510d0f153be3a343162fa921e77398659b764a7
4
+ data.tar.gz: 35ab3d0b82ada32bd091091b2f1759681b976356837301c35bf0d14016cc6fa9
5
5
  SHA512:
6
- metadata.gz: 07c5415be2991fdfed79ecbd27027272f9a59a72797b6a1efc0de021f9ae876e8949374a307da9663c3c36c6603ed8a8e4aedcf0009076354d0fe079572e2330
7
- data.tar.gz: 47e5ca4b87727558c5c99a2e7134de3f7fec886b46f007f4af287e4ba91ee1e9fa71d578428da2149e42d2dce37ae0dd79f84684fb824f50004ed23b13345e1b
6
+ metadata.gz: 134a73bd275a3f1c50d453fc9d4ee3f7b17a54293099d0b0c539e8cb87f2fc66993f2ad237b62ea789580a18a0ddeb785bade259ca24305d0211cea18f477e52
7
+ data.tar.gz: 23f201b5a03917d066f558f34d3b14d7bb6218cc8ef090ec3d26766f4aaab318d430256463a61cc00828fc60a3f24de290411a0015dbd689dd93a9b8add4bf87
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
+ ## 10.2.3
2
+ - Opened type removal logic for extension. This allows X-Pack Elasticsearch output to continue using types for special case `/_monitoring` bulk endpoint, enabling a fix for LogStash #11312. [#900](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/900)
3
+
1
4
  ## 10.2.2
2
- - Fixed 8.x type removal compatibility issue [#892](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/892)
5
+ - Fixed 8.x type removal compatibility issue [#892](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/892)
3
6
 
4
7
  ## 10.2.1
5
8
  - Fixed wording and corrected option in documentation [#881](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/881) [#883](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/883)
@@ -168,14 +171,14 @@
168
171
 
169
172
  ## 6.2.3
170
173
  - Fixed a bug introduced in 6.2.2 where passwords needing escapes were not actually sent to ES properly
171
- encoded.
174
+ encoded.
172
175
 
173
176
  ## 6.2.2
174
177
  - Fixed a bug that forced users to URL encode the `password` option.
175
178
  If you are currently manually escaping your passwords upgrading to this version
176
179
  will break authentication. You should unescape your password if you have implemented
177
180
  this workaround as it will otherwise be doubly encoded.
178
- URL escaping is STILL required for passwords inline with URLs in the `hosts` option.
181
+ URL escaping is STILL required for passwords inline with URLs in the `hosts` option.
179
182
 
180
183
  ## 6.2.1
181
184
  - When an HTTP error is encountered, log the response body instead of the request.
@@ -189,7 +192,7 @@
189
192
 
190
193
  ## 6.0.0
191
194
  - Proxies requiring auth now always work when a URL is specified
192
- - It is no longer possible to specify a proxy as a hash due to security reasons
195
+ - It is no longer possible to specify a proxy as a hash due to security reasons
193
196
  - Fix URL normalization logic to correctly apply all settings to sniffed hosts
194
197
  - Proxies requiring auth now always work when a URL is specified
195
198
  - Switch internals to new LogStash::Util::SafeURI type for more defensive approach to logging credentials
data/docs/index.asciidoc CHANGED
@@ -64,6 +64,58 @@ LS will not force upgrade the template, if `logstash` template already exists. T
64
64
  `.raw` for sub-fields coming from 2.x. If you choose to use the new template, you will have to reindex your data after
65
65
  the new template is installed.
66
66
 
67
+ ==== Writing to different indices: best practices
68
+
69
+ [NOTE]
70
+ ================================================================================
71
+ You cannot use dynamic variable substitution when `ilm_enabled` is `true` and
72
+ when using `ilm_rollover_pattern`.
73
+
74
+ ================================================================================
75
+
76
+ If you're sending events to the same Elasticsearch cluster but you're targeting different indices you can:
77
+
78
+ * use different Elasticsearch outputs, each one with a different value for the `index` parameter
79
+ * use one Elasticsearch output and use the dynamic variable substitution for the `index` parameter
80
+
81
+ Each Elasticsearch output is a new client connected to the cluster:
82
+
83
+ * it has to initialize the client and connect to Elasticsearch (restart time is longer if you have more clients)
84
+ * it has an associated connection pool
85
+
86
+ In order to minimize the number of open connections to Elasticsearch, maximize the bulk size and reduce the number of "small" bulk requests (which could easily fill up the queue), it is usually more efficient to have a single Elasticsearch output.
87
+
88
+ Example:
89
+ [source,ruby]
90
+ output {
91
+ elasticsearch {
92
+ index => "%{[some_field][sub_field]}-%{+YYYY.MM.dd}"
93
+ }
94
+ }
95
+
96
+ **What to do in case there is no field in the event containing the destination index prefix?**
97
+
98
+ You can use the `mutate` filter and conditionals to add a `[@metadata]` field (see https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#metadata) to set
99
+ the destination index for each event. The `[@metadata]` fields will not be sent to Elasticsearch.
100
+
101
+ Example:
102
+ [source,ruby]
103
+ filter {
104
+ if [log_type] in [ "test", "staging" ] {
105
+ mutate { add_field => { "[@metadata][target_index]" => "test-%{+YYYY.MM}" } }
106
+ } else if [log_type] == "production" {
107
+ mutate { add_field => { "[@metadata][target_index]" => "prod-%{+YYYY.MM.dd}" } }
108
+ } else {
109
+ mutate { add_field => { "[@metadata][target_index]" => "unknown-%{+YYYY}" } }
110
+ }
111
+ }
112
+ output {
113
+ elasticsearch {
114
+ index => "%{[@metadata][target_index]}"
115
+ }
116
+ }
117
+
118
+
67
119
  ==== Retry Policy
68
120
 
69
121
  The retry policy has changed significantly in the 8.1.1 release.
@@ -423,6 +475,8 @@ NOTE: If both `index` and `ilm_rollover_alias` are specified, `ilm_rollover_alia
423
475
 
424
476
  NOTE: Updating the rollover alias will require the index template to be rewritten
425
477
 
478
+ NOTE: `ilm_rollover_alias` does NOT support dynamic variable substitution as `index` does.
479
+
426
480
  [id="plugins-{type}s-{plugin}-index"]
427
481
  ===== `index`
428
482
 
@@ -62,9 +62,12 @@ module LogStash; module Outputs; class ElasticSearch;
62
62
  !!maximum_seen_major_version
63
63
  end
64
64
 
65
+ def use_event_type?(client)
66
+ client.maximum_seen_major_version < 8
67
+ end
68
+
65
69
  # Convert the event into a 3-tuple of action, params, and event
66
70
  def event_action_tuple(event)
67
-
68
71
  action = event.sprintf(@action)
69
72
 
70
73
  params = {
@@ -73,7 +76,7 @@ module LogStash; module Outputs; class ElasticSearch;
73
76
  routing_field_name => @routing ? event.sprintf(@routing) : nil
74
77
  }
75
78
 
76
- params[:_type] = get_event_type(event) if client.maximum_seen_major_version < 8
79
+ params[:_type] = get_event_type(event) if use_event_type?(client)
77
80
 
78
81
  if @pipeline
79
82
  params[:pipeline] = event.sprintf(@pipeline)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '10.2.2'
3
+ s.version = '10.2.3'
4
4
  s.licenses = ['apache-2.0']
5
5
  s.summary = "Stores logs in Elasticsearch"
6
6
  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"
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.2.2
4
+ version: 10.2.3
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2019-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement