logstash-output-elasticsearch 11.22.9-java → 11.22.10-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: 1276b8bd29a1332d9dadb06c92e9c62b70e23293a7316d62c8e124b492f7b6b8
4
- data.tar.gz: 7c6163b80bcffa621a2d19c91133b9d66733781ae5075f403a478ba0a7d122ed
3
+ metadata.gz: 1ce26f1744954843bcf5738f6ea07c57ecde6a2b5e63e827d9117bffeb8d2857
4
+ data.tar.gz: cb9306e7fa13d3aeb1edf089035047f1db95debd5490675ccaabf28771dabbb6
5
5
  SHA512:
6
- metadata.gz: '092df2c01ae5c4f9e364bb56469ba3acbf705391bd4c04e65891deae3b9c377fd3be37c6dd6b12b0e9de2f4a3125e4d09df0de6d8dd03bc7ada19a85b1eaca4e'
7
- data.tar.gz: ca93c24e48e71360d5e9722ec35025241c40eac255e83c60ce65b5d607517752609bb304e6d091f02cd8df06d9607afcdbe43c1d2dfb6f5990972fe40c0e1bd1
6
+ metadata.gz: 7a1b4dfe4d8788794073b9cda092cad34d8a0a3f5a28e9b7ed77de1c4a88dc668c7db3c88279bab9c31d8a33f1ebe60eb70136d3a5a8c5d378cc9f0dd53d7c6b
7
+ data.tar.gz: b59c8d820a59cc7ef5c33d434714077568cb6fe20651d027893054f6c6bd0d89f6eeef6989313613a65f23cdab99abbf9594ea2ecd4cb4dc4f5edbed25733d98
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 11.22.10
2
+ - Add `x-elastic-product-origin` header to Elasticsearch requests [#1194](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1194)
3
+
1
4
  ## 11.22.9
2
5
  - Vendor ECS template for Elasticsearch 9.x in built gem [#1188](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1188)
3
6
 
@@ -2,7 +2,7 @@ require 'manticore'
2
2
  require 'cgi'
3
3
 
4
4
  module LogStash; module Outputs; class ElasticSearch; class HttpClient;
5
- DEFAULT_HEADERS = { "Content-Type" => "application/json" }
5
+ DEFAULT_HEADERS = { "Content-Type" => "application/json", 'x-elastic-product-origin' => 'logstash-output-elasticsearch' }
6
6
 
7
7
  class ManticoreAdapter
8
8
  attr_reader :manticore, :logger
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '11.22.9'
3
+ s.version = '11.22.10'
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"
@@ -32,6 +32,13 @@ end
32
32
  let(:http_client) do
33
33
  Manticore::Client.new(http_client_options)
34
34
  end
35
+ let(:expected_headers) {
36
+ {
37
+ "Content-Encoding" => "gzip",
38
+ "Content-Type" => "application/json",
39
+ 'x-elastic-product-origin' => 'logstash-output-elasticsearch'
40
+ }
41
+ }
35
42
 
36
43
  before do
37
44
  subject.register
@@ -64,7 +71,7 @@ end
64
71
 
65
72
  it "sets the correct content-encoding header and body is compressed" do
66
73
  expect(subject.client.pool.adapter.client).to receive(:send).
67
- with(anything, anything, {:headers=>{"Content-Encoding"=>"gzip", "Content-Type"=>"application/json"}, :body => a_valid_gzip_encoded_string}).
74
+ with(anything, anything, {:headers=> expected_headers, :body => a_valid_gzip_encoded_string}).
68
75
  and_call_original
69
76
  subject.multi_receive(events)
70
77
  end
@@ -214,10 +214,13 @@ describe "indexing" do
214
214
  end
215
215
 
216
216
  it "sets the correct content-type header" do
217
- expected_manticore_opts = {:headers => {"Content-Type" => "application/json"}, :body => anything}
217
+ expected_manticore_opts = {
218
+ :headers => {"Content-Type" => "application/json", 'x-elastic-product-origin' => 'logstash-output-elasticsearch'},
219
+ :body => anything
220
+ }
218
221
  if secure
219
222
  expected_manticore_opts = {
220
- :headers => {"Content-Type" => "application/json"},
223
+ :headers => {"Content-Type" => "application/json", 'x-elastic-product-origin' => 'logstash-output-elasticsearch'},
221
224
  :body => anything,
222
225
  :auth => {
223
226
  :user => user,
@@ -34,7 +34,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter do
34
34
 
35
35
  expect(subject.manticore).to receive(:get).
36
36
  with(expected_uri.to_s, {
37
- :headers => {"Content-Type" => "application/json"},
37
+ :headers => LogStash::Outputs::ElasticSearch::HttpClient::DEFAULT_HEADERS,
38
38
  :auth => {
39
39
  :user => user,
40
40
  :password => password,
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.9
4
+ version: 11.22.10
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-13 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement