logstash-output-elasticsearch 11.22.1-java → 11.22.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/docs/index.asciidoc +51 -24
- data/lib/logstash/outputs/elasticsearch/http_client.rb +6 -1
- data/logstash-output-elasticsearch.gemspec +1 -1
- data/spec/integration/outputs/compressed_indexing_spec.rb +4 -1
- data/spec/unit/outputs/elasticsearch/http_client_spec.rb +8 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f11cbc421fcbb44c5d993d70f97a8a32c79a278b5770805d5d82c3f63bdde681
|
4
|
+
data.tar.gz: 38ea003c71ed10ac5bffe531a16404c27670c67a6f06fbd637ed5d1544970e59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8efac5e9e84066e1dbe7272b9bb04276d10b34983d8f8dc49824663c67c55be1e5a1bad3c5f7f13bdb2512e995ca1f0dab13f890a596f1ca73ff49a99414fc3
|
7
|
+
data.tar.gz: 442f1690d2d96f87536a95d1827bba4e8029891209cf27fe5f380b126100288e9c3ca08dcfab6e0ce256ed24ddc74f91f318d81f0885b32fb8f9a45c1a388735
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 11.22.3
|
2
|
+
- Fixes an issue where events containing non-unicode strings could fail to serialize correctly when compression is enabled [#1169](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1169)
|
3
|
+
|
4
|
+
## 11.22.2
|
5
|
+
- [DOC] Add content for sending data to Elasticsearch on serverless [#1164](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1164)
|
6
|
+
|
1
7
|
## 11.22.1
|
2
8
|
- Fix, avoid to populate `version` and `version_type` attributes when processing integration metadata and datastream is enabled. [#1161](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1161)
|
3
9
|
|
data/docs/index.asciidoc
CHANGED
@@ -30,7 +30,7 @@ the website landing page or in the {ref}[Elasticsearch documentation].
|
|
30
30
|
|
31
31
|
.Compatibility Note
|
32
32
|
[NOTE]
|
33
|
-
|
33
|
+
=====
|
34
34
|
When connected to Elasticsearch 7.x, modern versions of this plugin
|
35
35
|
don't use the document-type when inserting documents, unless the user
|
36
36
|
explicitly sets <<plugins-{type}s-{plugin}-document_type>>.
|
@@ -42,9 +42,30 @@ picks up changes to the Elasticsearch index template.
|
|
42
42
|
If you are using a custom <<plugins-{type}s-{plugin}-template>>,
|
43
43
|
ensure your template uses the `_doc` document-type before
|
44
44
|
connecting to Elasticsearch 7.x.
|
45
|
-
|
45
|
+
=====
|
46
46
|
|
47
|
-
|
47
|
+
[id="plugins-{type}s-{plugin}-serverless"]
|
48
|
+
==== {ls} to {es-serverless}
|
49
|
+
|
50
|
+
You can use this plugin to send your {ls} data to {es-serverless}.
|
51
|
+
Some differences to note between {es-serverless} and self-managed {es}:
|
52
|
+
|
53
|
+
* Use *API keys* to access {serverless-full} from {ls}.
|
54
|
+
Any user-based security settings in your <<plugins-outputs-elasticsearch,{es} output plugin>> configuration are ignored and may cause errors.
|
55
|
+
* {es-serverless} uses *data streams* and {ref}/data-stream-lifecycle.html[{dlm} ({dlm-init})] instead of {ilm} ({ilm-init}).
|
56
|
+
Any {ilm-init} settings in your <<plugins-outputs-elasticsearch,{es} output plugin>> configuration are ignored and may cause errors.
|
57
|
+
* *{ls} monitoring* is available through the https://github.com/elastic/integrations/blob/main/packages/logstash/_dev/build/docs/README.md[{ls} Integration] in {serverless-docs}/observability/what-is-observability-serverless[Elastic Observability] on {serverless-full}.
|
58
|
+
|
59
|
+
.Known issue for {ls} to {es-serverless}
|
60
|
+
****
|
61
|
+
The logstash-output-elasticsearch `hosts` setting on {serverless-short} defaults the port to 9200 when omitted.
|
62
|
+
Set the value to port :443 instead.
|
63
|
+
****
|
64
|
+
|
65
|
+
For more info on sending data from {ls} to {es-serverless}, check out the {serverless-docs}/elasticsearch/what-is-elasticsearch-serverless[{es-serverless} docs].
|
66
|
+
|
67
|
+
[id="plugins-{type}s-{plugin}-ess"]
|
68
|
+
==== Hosted {es} Service on Elastic Cloud
|
48
69
|
|
49
70
|
{ess-leadin}
|
50
71
|
|
@@ -68,8 +89,8 @@ and will correctly reject events with fields that conflict and cannot be coerced
|
|
68
89
|
The {es} output plugin can store both time series datasets (such
|
69
90
|
as logs, events, and metrics) and non-time series data in Elasticsearch.
|
70
91
|
|
71
|
-
|
72
|
-
as logs, metrics, and events) into {es}:
|
92
|
+
Use the data stream options for indexing time series datasets (such
|
93
|
+
as logs, metrics, and events) into {es} and {es-serverless}:
|
73
94
|
|
74
95
|
* <<plugins-{type}s-{plugin}-data_stream>>
|
75
96
|
* <<plugins-{type}s-{plugin}-data_stream_auto_routing>>
|
@@ -200,27 +221,28 @@ The list of error codes accepted for DLQ could be customized with <<plugins-{typ
|
|
200
221
|
but should be used only in motivated cases.
|
201
222
|
|
202
223
|
[id="plugins-{type}s-{plugin}-ilm"]
|
203
|
-
====
|
204
|
-
|
205
|
-
[NOTE]
|
206
|
-
The Index Lifecycle Management feature requires plugin version `9.3.1` or higher.
|
224
|
+
==== {ilm-cap} ({ilm-init})
|
207
225
|
|
208
226
|
[NOTE]
|
209
|
-
|
227
|
+
--
|
228
|
+
* The {ilm-cap} ({ilm-init}) feature does not apply for {es-serverless}.
|
229
|
+
Any {ilm-init} settings in your plugin configuration are ignored and may cause errors.
|
230
|
+
* The {ilm-init} feature requires plugin version `9.3.1` or higher.
|
231
|
+
* This feature requires an {es} instance of 6.6.0 or higher with at least a Basic license
|
232
|
+
--
|
210
233
|
|
211
|
-
|
212
|
-
Management] to automate the management of indices over time.
|
234
|
+
{ls} can use {ref}/index-lifecycle-management.html[{ilm}] to automate the management of indices over time.
|
213
235
|
|
214
|
-
The use of
|
236
|
+
The use of {ilm} is controlled by the `ilm_enabled`
|
215
237
|
setting. By default, this setting detects whether the Elasticsearch instance
|
216
|
-
supports
|
217
|
-
`true` or `false` to override the automatic detection, or disable
|
238
|
+
supports {ilm-init}, and uses it if it is available. `ilm_enabled` can also be set to
|
239
|
+
`true` or `false` to override the automatic detection, or disable {ilm-init}.
|
218
240
|
|
219
|
-
This will overwrite the index settings and adjust the
|
220
|
-
the necessary settings for the template to support
|
241
|
+
This will overwrite the index settings and adjust the {ls} template to write
|
242
|
+
the necessary settings for the template to support {ilm},
|
221
243
|
including the index policy and rollover alias to be used.
|
222
244
|
|
223
|
-
|
245
|
+
{ls} creates a rollover alias for the indices to be written to,
|
224
246
|
including a pattern for how the actual indices will be named, and unless an ILM
|
225
247
|
policy that already exists has been specified, a default policy will also be
|
226
248
|
created. The default policy is configured to rollover an index when it reaches
|
@@ -246,14 +268,14 @@ See config below for an example:
|
|
246
268
|
}
|
247
269
|
}
|
248
270
|
|
249
|
-
NOTE
|
250
|
-
|
251
|
-
|
271
|
+
[NOTE]
|
272
|
+
--
|
273
|
+
* Custom ILM policies must already exist on the {es} cluster before they can be used.
|
274
|
+
* If the rollover alias or pattern is modified, the index template will need to be
|
252
275
|
overwritten as the settings `index.lifecycle.name` and
|
253
276
|
`index.lifecycle.rollover_alias` are automatically written to the template
|
254
|
-
|
255
|
-
|
256
|
-
|
277
|
+
* If the index property is supplied in the output definition, it will be overwritten by the rollover alias.
|
278
|
+
--
|
257
279
|
|
258
280
|
==== Batch Sizes
|
259
281
|
|
@@ -294,6 +316,11 @@ index level and `monitoring` permissions at cluster level. The `monitoring`
|
|
294
316
|
permission at cluster level is necessary to perform periodic connectivity
|
295
317
|
checks.
|
296
318
|
|
319
|
+
[id="plugins-{type}s-{plugin}-handling-non-utf-8"]
|
320
|
+
==== Handling non UTF-8 data
|
321
|
+
|
322
|
+
This plugin transmits events to Elasticsearch using a JSON API, and therefore requires that all string values in events to be valid UTF-8.
|
323
|
+
When a string value on an event contains one or more byte sequences that are not valid in UTF-8, each offending byte sequence is replaced with the UTF-8 replacement character (`\uFFFD`).
|
297
324
|
|
298
325
|
[id="plugins-{type}s-{plugin}-options"]
|
299
326
|
==== Elasticsearch Output Configuration Options
|
@@ -22,6 +22,7 @@ module LogStash; module Outputs; class ElasticSearch;
|
|
22
22
|
# made sense. We picked one on the lowish side to not use too much heap.
|
23
23
|
TARGET_BULK_BYTES = 20 * 1024 * 1024 # 20MiB
|
24
24
|
|
25
|
+
|
25
26
|
class HttpClient
|
26
27
|
attr_reader :client, :options, :logger, :pool, :action_count, :recv_count
|
27
28
|
# This is here in case we use DEFAULT_OPTIONS in the future
|
@@ -37,7 +38,7 @@ module LogStash; module Outputs; class ElasticSearch;
|
|
37
38
|
# * `:user` - String. The user to use for authentication.
|
38
39
|
# * `:password` - String. The password to use for authentication.
|
39
40
|
# * `:timeout` - Float. A duration value, in seconds, after which a socket
|
40
|
-
# operation or request will be aborted if not yet
|
41
|
+
# operation or request will be aborted if not yet successful
|
41
42
|
# * `:client_settings` - a hash; see below for keys.
|
42
43
|
#
|
43
44
|
# The `client_settings` key is a has that can contain other settings:
|
@@ -132,6 +133,9 @@ module LogStash; module Outputs; class ElasticSearch;
|
|
132
133
|
action.map {|line| LogStash::Json.dump(line)}.join("\n") :
|
133
134
|
LogStash::Json.dump(action)
|
134
135
|
as_json << "\n"
|
136
|
+
|
137
|
+
as_json.scrub! # ensure generated JSON is valid UTF-8
|
138
|
+
|
135
139
|
if (stream_writer.pos + as_json.bytesize) > TARGET_BULK_BYTES && stream_writer.pos > 0
|
136
140
|
stream_writer.flush # ensure writer has sync'd buffers before reporting sizes
|
137
141
|
logger.debug("Sending partial bulk request for batch with one or more actions remaining.",
|
@@ -496,5 +500,6 @@ module LogStash; module Outputs; class ElasticSearch;
|
|
496
500
|
end
|
497
501
|
[args, source]
|
498
502
|
end
|
503
|
+
|
499
504
|
end
|
500
505
|
end end end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-elasticsearch'
|
3
|
-
s.version = '11.22.
|
3
|
+
s.version = '11.22.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"
|
@@ -11,10 +11,13 @@ end
|
|
11
11
|
[ {"http_compression" => true}, {"compression_level" => 1} ].each do |compression_config|
|
12
12
|
describe "indexing with http_compression turned on", :integration => true do
|
13
13
|
let(:event) { LogStash::Event.new("message" => "Hello World!", "type" => type) }
|
14
|
+
let(:event_with_invalid_utf_8_bytes) { LogStash::Event.new("message" => "Message from spacecraft which contains \xAC invalid \xD7 byte sequences.", "type" => type) }
|
15
|
+
|
14
16
|
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
|
15
17
|
let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
|
16
18
|
let(:event_count) { 10000 + rand(500) }
|
17
|
-
|
19
|
+
# mix the events with valid and invalid UTF-8 payloads
|
20
|
+
let(:events) { event_count.times.map { |i| i%3 == 0 ? event : event_with_invalid_utf_8_bytes }.to_a }
|
18
21
|
let(:config) {
|
19
22
|
{
|
20
23
|
"hosts" => get_host_port,
|
@@ -242,12 +242,14 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
|
-
context "with
|
246
|
-
let(:
|
247
|
-
let(:
|
245
|
+
context "with multiple messages" do
|
246
|
+
let(:message_head) { "Spacecraft message" }
|
247
|
+
let(:message_tail) { "byte sequence" }
|
248
|
+
let(:invalid_utf_8_message) { "contains invalid \xAC" }
|
248
249
|
let(:actions) { [
|
249
|
-
["index", {:_id=>nil, :_index=>"logstash"}, {"message"=>
|
250
|
-
["index", {:_id=>nil, :_index=>"logstash"}, {"message"=>
|
250
|
+
["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> message_head}],
|
251
|
+
["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> invalid_utf_8_message}],
|
252
|
+
["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> message_tail}],
|
251
253
|
]}
|
252
254
|
it "executes one bulk_send operation" do
|
253
255
|
allow(subject).to receive(:join_bulk_responses)
|
@@ -257,7 +259,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
|
|
257
259
|
|
258
260
|
context "if one exceeds TARGET_BULK_BYTES" do
|
259
261
|
let(:target_bulk_bytes) { LogStash::Outputs::ElasticSearch::TARGET_BULK_BYTES }
|
260
|
-
let(:
|
262
|
+
let(:message_head) { "a" * (target_bulk_bytes + 1) }
|
261
263
|
it "executes two bulk_send operations" do
|
262
264
|
allow(subject).to receive(:join_bulk_responses)
|
263
265
|
expect(subject).to receive(:bulk_send).twice
|
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: 11.22.
|
4
|
+
version: 11.22.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|