logstash-output-opensearch 2.0.1-java → 2.0.3-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/DEVELOPER_GUIDE.md +6 -1
- data/MAINTAINERS.md +12 -1
- data/README.md +9 -4
- data/docs/building_custom_docker_images.md +79 -0
- data/lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb +21 -3
- data/lib/logstash/plugin_mixins/opensearch/common.rb +1 -0
- data/logstash-output-opensearch.gemspec +1 -1
- data/spec/integration/outputs/index_spec.rb +3 -2
- data/spec/opensearch_spec_helper.rb +9 -0
- data/spec/unit/outputs/opensearch/http_client/manticore_adapter_spec.rb +65 -20
- data/spec/unit/outputs/opensearch_spec.rb +24 -0
- data.tar.gz.sig +0 -0
- metadata +23 -22
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4d023016ab9043a845b0c4c35fc0fea899235e8f15d32f8cc9799a29dd4a84a
|
4
|
+
data.tar.gz: 1eef3e646ab7a2ec0ac175fa26b3fe7983755133de4bb0580ea55299d55ce18c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e22c44f48115c0df680dc9dc1e886daa5ac1521daf1a3b1ee3c9f5574eed59e7974356bff2055dfc44c0ed01115cb8838b073ffa7b81d70172b5da227c718584
|
7
|
+
data.tar.gz: 98556ece3e0e8f771a8168bffb32d6b8be5d4e21d356cbd64ddb814b26ac5cb91c3b58a94f49dec72e377a67cb3896008a7441f9db2373bcf3c15de9f7ece2a9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/DEVELOPER_GUIDE.md
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
- [Configuration for Logstash Output OpenSearch Plugin](#configuration-for-logstash-output-opensearch-plugin)
|
10
10
|
- [Submitting Changes](#submitting-changes)
|
11
11
|
- [Backports](#backports)
|
12
|
+
- [Building Custom Docker Images](docs/building_custom_docker_images.md)
|
12
13
|
|
13
14
|
# Developer Guide
|
14
15
|
|
@@ -185,13 +186,14 @@ Build the gem locally and install it using:
|
|
185
186
|
## Configuration for Logstash Output OpenSearch Plugin
|
186
187
|
|
187
188
|
To run the Logstash Output Opensearch plugin, add following configuration in your logstash.conf file.
|
189
|
+
Note: For logstash running with OpenSearch 2.12.0 and higher the admin password needs to be a custom strong password supplied during cluster setup.
|
188
190
|
|
189
191
|
```
|
190
192
|
output {
|
191
193
|
opensearch {
|
192
194
|
hosts => ["hostname:port"]
|
193
195
|
user => "admin"
|
194
|
-
password => "admin"
|
196
|
+
password => "<your-admin-password>"
|
195
197
|
index => "logstash-logs-%{+YYYY.MM.dd}"
|
196
198
|
}
|
197
199
|
}
|
@@ -215,3 +217,6 @@ original PR with an appropriate label `backport <backport-branch-name>` is merge
|
|
215
217
|
run successfully on the PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label
|
216
218
|
`backport 1.x` to the PR and make sure the backport workflow runs on the PR along with other checks. Once this PR is
|
217
219
|
merged to main, the workflow will create a backport PR to the `1.x` branch.
|
220
|
+
|
221
|
+
# [Building Custom Docker Images](docs/building_custom_docker_images.md)
|
222
|
+
|
data/MAINTAINERS.md
CHANGED
@@ -4,11 +4,22 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
|
|
4
4
|
|
5
5
|
## Current Maintainers
|
6
6
|
|
7
|
+
|
8
|
+
| Maintainer | GitHub ID | Affiliation |
|
9
|
+
| ------------------------ | --------------------------------------------------- | ----------- |
|
10
|
+
| Daniel "dB." Doubrovkine | [dblock](https://github.com/dblock) | Amazon |
|
11
|
+
| Asif Sohail Mohammed | [asifsmohammed](https://github.com/asifsmohammed) | Amazon |
|
12
|
+
| David Venable | [dlvenable](https://github.com/dlvenable) | Amazon |
|
13
|
+
| Hai Yan | [oeyh](https://github.com/oeyh) | Amazon |
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
## Emeritus
|
18
|
+
|
7
19
|
| Maintainer | GitHub ID | Affiliation |
|
8
20
|
| ----------------------- | ------------------------------------------- | ----------- |
|
9
21
|
| Jack Mazanec | [jmazanec15](https://github.com/jmazanec15) | Amazon |
|
10
22
|
| Vamshi Vijay Nakkirtha | [vamshin](https://github.com/vamshin) | Amazon |
|
11
23
|
| Vijayan Balasubramanian | [VijayanB](https://github.com/VijayanB) | Amazon |
|
12
24
|
| Deep Datta | [deepdatta](https://github.com/deepdatta) | Amazon |
|
13
|
-
| David Venable | [dlvenable](https://github.com/dlvenable) | Amazon |
|
14
25
|
| Shivani Shukla | [sshivanii](https://github.com/sshivanii) | Amazon |
|
data/README.md
CHANGED
@@ -32,12 +32,14 @@ The logstash-output-opensearch plugin helps to ship events from Logstash to Open
|
|
32
32
|
## Configuration for Logstash Output Opensearch Plugin
|
33
33
|
|
34
34
|
To run the Logstash Output Opensearch plugin, add following configuration in your logstash.conf file.
|
35
|
+
Note: For logstash running with OpenSearch 2.12.0 and higher the admin password needs to be a custom strong password supplied during cluster setup.
|
36
|
+
|
35
37
|
```
|
36
38
|
output {
|
37
39
|
opensearch {
|
38
40
|
hosts => ["hostname:port"]
|
39
41
|
user => "admin"
|
40
|
-
password => "admin"
|
42
|
+
password => "<your-admin-password>"
|
41
43
|
index => "logstash-logs-%{+YYYY.MM.dd}"
|
42
44
|
}
|
43
45
|
}
|
@@ -62,6 +64,8 @@ output {
|
|
62
64
|
In addition to the existing authentication mechanisms, if we want to add new authentication then we will be adding them in the configuration by using auth_type.
|
63
65
|
|
64
66
|
Example Configuration for basic authentication:
|
67
|
+
Note: For logstash running with OpenSearch 2.12.0 and higher the admin password needs to be a custom strong password supplied during cluster setup.
|
68
|
+
|
65
69
|
```
|
66
70
|
output {
|
67
71
|
opensearch {
|
@@ -69,7 +73,7 @@ output {
|
|
69
73
|
auth_type => {
|
70
74
|
type => 'basic'
|
71
75
|
user => 'admin'
|
72
|
-
password => 'admin'
|
76
|
+
password => '<your-admin-password>'
|
73
77
|
}
|
74
78
|
index => "logstash-logs-%{+YYYY.MM.dd}"
|
75
79
|
}
|
@@ -77,6 +81,7 @@ output {
|
|
77
81
|
```
|
78
82
|
|
79
83
|
To ingest data into a `data stream` through logstash, we need to create the data stream and specify the name of data stream and the `op_type` of `create` in the output configuration. The sample configuration is shown below:
|
84
|
+
Note: For logstash running with OpenSearch 2.12.0 and higher the admin password needs to be a custom strong password supplied during cluster setup.
|
80
85
|
|
81
86
|
```yml
|
82
87
|
output {
|
@@ -85,7 +90,7 @@ output {
|
|
85
90
|
auth_type => {
|
86
91
|
type => 'basic'
|
87
92
|
user => 'admin'
|
88
|
-
password => 'admin'
|
93
|
+
password => '<your-admin-password>'
|
89
94
|
}
|
90
95
|
index => "my-data-stream"
|
91
96
|
action => "create"
|
@@ -105,7 +110,7 @@ Starting in 2.0.0, the aws sdk version is bumped to v3. In order for all other A
|
|
105
110
|
/usr/share/logstash/bin/logstash-plugin remove logstash-output-cloudwatch
|
106
111
|
|
107
112
|
/usr/share/logstash/bin/logstash-plugin install --version 0.1.0.pre logstash-integration-aws
|
108
|
-
bin/logstash-plugin install --version 2.0.0 logstash-output-opensearch
|
113
|
+
/usr/share/logstash/bin/logstash-plugin install --version 2.0.0 logstash-output-opensearch
|
109
114
|
```
|
110
115
|
## ECS Compatibility
|
111
116
|
[Elastic Common Schema(ECS)](https://www.elastic.co/guide/en/ecs/current/index.html]) compatibility for V8 was added in 1.3.0. For more details on ECS support refer to this [documentation](docs/ecs_compatibility.md).
|
@@ -0,0 +1,79 @@
|
|
1
|
+
- [Building Custom Docker Images](#building-custom-docker-images)
|
2
|
+
- [Logstash 8.x](#logstash-8x)
|
3
|
+
- [Logstash 7.x](#logstash-7x)
|
4
|
+
- [Build Logstash Output OpenSearch Plugin Gem](#build-logstash-output-opensearch-plugin-gem)
|
5
|
+
- [Dockerfile](#dockerfile)
|
6
|
+
|
7
|
+
|
8
|
+
# Building Custom Docker Images
|
9
|
+
|
10
|
+
To build an image that is not available in the [official Docker repository tags](https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin/tags), or to add specific plugins to your image, you can create a custom Dockerfile.
|
11
|
+
|
12
|
+
The process varies depending on whether you want to build an image with `Logstash 8.x` versions or `Logstash 7.x` versions
|
13
|
+
|
14
|
+
## Logstash 8.x
|
15
|
+
|
16
|
+
Create this `Dockerfile` to build an image with `OpenSearch 2.0.2` for **`Logstash 8.x`**
|
17
|
+
|
18
|
+
``` Dockerfile
|
19
|
+
ARG APP_VERSION
|
20
|
+
|
21
|
+
FROM docker.elastic.co/logstash/logstash-oss:${APP_VERSION}
|
22
|
+
RUN logstash-plugin install --version 7.1.1 logstash-integration-aws
|
23
|
+
RUN logstash-plugin install --version 2.0.2 logstash-output-opensearch
|
24
|
+
```
|
25
|
+
|
26
|
+
## Logstash 7.x
|
27
|
+
|
28
|
+
For **`Logstash 7.x`** , the Logstash output OpenSearch gem needs to be build.
|
29
|
+
|
30
|
+
### Build Logstash Output OpenSearch Plugin Gem
|
31
|
+
|
32
|
+
1. Clone `logstash-output-opensearch repo`
|
33
|
+
|
34
|
+
```sh
|
35
|
+
git clone https://github.com/opensearch-project/logstash-output-opensearch.git
|
36
|
+
```
|
37
|
+
|
38
|
+
2. Checkout the tag for the plugin version you want to build. For the version [2.0.2](https://github.com/opensearch-project/logstash-output-opensearch/tree/2.0.2) for example
|
39
|
+
|
40
|
+
```sh
|
41
|
+
git checkout 2.0.2
|
42
|
+
```
|
43
|
+
|
44
|
+
|
45
|
+
3. Remove [this line that adds the json version spec](https://github.com/opensearch-project/logstash-output-opensearch/blob/2.0.2/logstash-output-opensearch.gemspec#L49). This version of the JSON gem is incompatible with `Logstash version 7.x`.
|
46
|
+
|
47
|
+
4. Build the gem by running the following command:
|
48
|
+
|
49
|
+
```sh
|
50
|
+
gem build logstash-output-opensearch.gemspec
|
51
|
+
```
|
52
|
+
|
53
|
+
The Gemfile `logstash-output-opensearch-2.0.2-x86_64-linux.gem` will be generated.
|
54
|
+
|
55
|
+
### Dockerfile
|
56
|
+
|
57
|
+
Create this Dockerfile to build an image with `logstash version 7.x` and the previously generated `Gemfile` :
|
58
|
+
|
59
|
+
```Dockerfile
|
60
|
+
ARG APP_VERSION
|
61
|
+
|
62
|
+
FROM docker.elastic.co/logstash/logstash-oss:${APP_VERSION}
|
63
|
+
|
64
|
+
USER logstash
|
65
|
+
# Remove existing logstash aws plugins and install logstash-integration-aws to keep sdk dependency the same
|
66
|
+
# https://github.com/logstash-plugins/logstash-mixin-aws/issues/38
|
67
|
+
# https://github.com/opensearch-project/logstash-output-opensearch#configuration-for-logstash-output-opensearch-plugin
|
68
|
+
RUN logstash-plugin remove logstash-input-s3
|
69
|
+
RUN logstash-plugin remove logstash-input-sqs
|
70
|
+
RUN logstash-plugin remove logstash-output-s3
|
71
|
+
RUN logstash-plugin remove logstash-output-sns
|
72
|
+
RUN logstash-plugin remove logstash-output-sqs
|
73
|
+
RUN logstash-plugin remove logstash-output-cloudwatch
|
74
|
+
|
75
|
+
RUN logstash-plugin install --version 7.1.1 logstash-integration-aws
|
76
|
+
|
77
|
+
COPY logstash-output-opensearch-2.0.2-x86_64-linux.gem /usr/share
|
78
|
+
RUN logstash-plugin install /usr/share/logstash-output-opensearch-2.0.2-x86_64-linux.gem
|
79
|
+
```
|
@@ -12,6 +12,9 @@ require 'cgi'
|
|
12
12
|
require 'manticore'
|
13
13
|
require 'uri'
|
14
14
|
|
15
|
+
java_import 'org.apache.http.util.EntityUtils'
|
16
|
+
java_import 'org.apache.http.entity.StringEntity'
|
17
|
+
|
15
18
|
module LogStash; module Outputs; class OpenSearch; class HttpClient;
|
16
19
|
AWS_DEFAULT_PORT = 443
|
17
20
|
AWS_DEFAULT_PROFILE = 'default'
|
@@ -30,7 +33,8 @@ module LogStash; module Outputs; class OpenSearch; class HttpClient;
|
|
30
33
|
:profile,
|
31
34
|
:instance_profile_credentials_retries,
|
32
35
|
:instance_profile_credentials_timeout,
|
33
|
-
:region
|
36
|
+
:region,
|
37
|
+
:account_id)
|
34
38
|
|
35
39
|
class ManticoreAdapter
|
36
40
|
attr_reader :manticore, :logger
|
@@ -75,10 +79,11 @@ module LogStash; module Outputs; class OpenSearch; class HttpClient;
|
|
75
79
|
instance_cred_retries = options[:auth_type]["instance_profile_credentials_retries"] || AWS_DEFAULT_PROFILE_CREDENTIAL_RETRY
|
76
80
|
instance_cred_timeout = options[:auth_type]["instance_profile_credentials_timeout"] || AWS_DEFAULT_PROFILE_CREDENTIAL_TIMEOUT
|
77
81
|
region = options[:auth_type]["region"] || AWS_DEFAULT_REGION
|
82
|
+
account_id = nil
|
78
83
|
set_aws_region(region)
|
79
84
|
set_service_name(options[:auth_type]["service_name"] || AWS_SERVICE)
|
80
85
|
|
81
|
-
credential_config = AWSIAMCredential.new(aws_access_key_id, aws_secret_access_key, session_token, profile, instance_cred_retries, instance_cred_timeout, region)
|
86
|
+
credential_config = AWSIAMCredential.new(aws_access_key_id, aws_secret_access_key, session_token, profile, instance_cred_retries, instance_cred_timeout, region, account_id)
|
82
87
|
@credentials = Aws::CredentialProviderChain.new(credential_config).resolve
|
83
88
|
end
|
84
89
|
|
@@ -181,8 +186,20 @@ module LogStash; module Outputs; class OpenSearch; class HttpClient;
|
|
181
186
|
resp
|
182
187
|
end
|
183
188
|
|
189
|
+
# from Manticore, https://github.com/cheald/manticore/blob/acc25cac2999f4658a77a0f39f60ddbca8fe14a4/lib/manticore/client.rb#L536
|
190
|
+
ISO_8859_1 = "ISO-8859-1".freeze
|
191
|
+
|
192
|
+
def minimum_encoding_for(string)
|
193
|
+
if string.ascii_only?
|
194
|
+
ISO_8859_1
|
195
|
+
else
|
196
|
+
string.encoding.to_s
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
184
200
|
def sign_aws_request(request_uri, path, method, params)
|
185
201
|
url = URI::HTTPS.build({:host=>URI(request_uri.to_s).host, :port=>AWS_DEFAULT_PORT.to_s, :path=>path})
|
202
|
+
|
186
203
|
request = Seahorse::Client::Http::Request.new(options={:endpoint=>url, :http_method => method.to_s.upcase,
|
187
204
|
:headers => params[:headers],:body => params[:body]})
|
188
205
|
|
@@ -191,7 +208,8 @@ module LogStash; module Outputs; class OpenSearch; class HttpClient;
|
|
191
208
|
http_method: request.http_method,
|
192
209
|
url: url,
|
193
210
|
headers: params[:headers],
|
194
|
-
|
211
|
+
# match encoding of the HTTP adapter, see https://github.com/opensearch-project/logstash-output-opensearch/issues/207
|
212
|
+
body: params[:body] ? EntityUtils.toString(StringEntity.new(params[:body], minimum_encoding_for(params[:body]))) : nil
|
195
213
|
)
|
196
214
|
params[:headers] = params[:headers].merge(signed_key.headers)
|
197
215
|
end
|
@@ -87,6 +87,7 @@ module LogStash; module PluginMixins; module OpenSearch
|
|
87
87
|
|
88
88
|
def discover_cluster_uuid
|
89
89
|
return unless defined?(plugin_metadata)
|
90
|
+
return if params && params['auth_type'] && params['auth_type']['service_name'] == "aoss" # AOSS doesn't support GET /
|
90
91
|
cluster_info = client.get('/')
|
91
92
|
plugin_metadata.set(:cluster_uuid, cluster_info['cluster_uuid'])
|
92
93
|
rescue => e
|
@@ -140,7 +140,7 @@ describe "indexing" do
|
|
140
140
|
end
|
141
141
|
describe "a secured indexer", :secure_integration => true do
|
142
142
|
let(:user) { "admin" }
|
143
|
-
let(:password) {
|
143
|
+
let(:password) { OpenSearchHelper.admin_password }
|
144
144
|
let(:opensearch_url) {"https://integration:9200"}
|
145
145
|
let(:config) do
|
146
146
|
{
|
@@ -172,7 +172,8 @@ describe "indexing" do
|
|
172
172
|
:auth_type => {
|
173
173
|
"type"=>"basic",
|
174
174
|
"user" => "admin",
|
175
|
-
"password" =>
|
175
|
+
"password" => OpenSearchHelper.admin_password
|
176
|
+
}
|
176
177
|
} }
|
177
178
|
let(:user) {options[:auth_type]["user"]}
|
178
179
|
let(:password) {options[:auth_type]["password"]}
|
@@ -72,6 +72,15 @@ module OpenSearchHelper
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
+
# set admin password based on version
|
76
|
+
def self.admin_password
|
77
|
+
if check_version?('< 2.12.0') || check_version?('> 7')
|
78
|
+
"admin"
|
79
|
+
else
|
80
|
+
"myStrongPassword123!"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
75
84
|
def clean(client)
|
76
85
|
client.indices.delete_template(:name => "*")
|
77
86
|
client.indices.delete_index_template(:name => "logstash*") rescue nil
|
@@ -70,35 +70,80 @@ describe LogStash::Outputs::OpenSearch::HttpClient::ManticoreAdapter do
|
|
70
70
|
} }
|
71
71
|
subject { described_class.new(logger, options) }
|
72
72
|
let(:uri) { ::LogStash::Util::SafeURI.new("http://localhost:9200") }
|
73
|
-
let(:sign_aws_request) { }
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
it "should validate AWS IAM service_name config" do
|
81
|
-
expect(subject.aws_iam_auth_initialization(options_svc)).not_to be_nil
|
82
|
-
expect(subject.get_service_name).to eq("svc_test")
|
83
|
-
end
|
74
|
+
let(:expected_uri) {
|
75
|
+
expected_uri = uri.clone
|
76
|
+
expected_uri.path = "/"
|
77
|
+
expected_uri
|
78
|
+
}
|
84
79
|
|
85
|
-
|
80
|
+
let(:resp) {
|
86
81
|
resp = double("response")
|
87
82
|
allow(resp).to receive(:call)
|
88
83
|
allow(resp).to receive(:code).and_return(200)
|
89
|
-
|
84
|
+
resp
|
85
|
+
}
|
90
86
|
|
91
|
-
|
92
|
-
|
87
|
+
context 'with a signer' do
|
88
|
+
let(:sign_aws_request) { }
|
93
89
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
90
|
+
it "should validate AWS IAM credentials initialization" do
|
91
|
+
expect(subject.aws_iam_auth_initialization(options)).not_to be_nil
|
92
|
+
expect(subject.get_service_name).to eq("es")
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should validate AWS IAM service_name config" do
|
96
|
+
expect(subject.aws_iam_auth_initialization(options_svc)).not_to be_nil
|
97
|
+
expect(subject.get_service_name).to eq("svc_test")
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should validate signing aws request" do
|
101
|
+
allow(subject).to receive(:sign_aws_request).with(any_args).and_return(sign_aws_request)
|
102
|
+
|
103
|
+
expect(subject.manticore).to receive(:get).
|
104
|
+
with(expected_uri.to_s, {
|
105
|
+
:headers => {"content-type"=> "application/json"}
|
106
|
+
}
|
107
|
+
).and_return resp
|
108
|
+
|
109
|
+
expect(subject).to receive(:sign_aws_request)
|
110
|
+
subject.perform_request(uri, :get, "/")
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
context 'sign_aws_request' do
|
115
|
+
it 'handles UTF-8' do
|
116
|
+
encoded_body = body = "boîte de réception"
|
117
|
+
expect_any_instance_of(Aws::Sigv4::Signer).to receive(:sign_request).with(hash_including({
|
118
|
+
body: body,
|
119
|
+
})).and_return(
|
120
|
+
double(headers: {})
|
121
|
+
)
|
122
|
+
expect(subject.manticore).to receive(:post).
|
123
|
+
with(expected_uri.to_s, {
|
124
|
+
:body => encoded_body,
|
125
|
+
:headers => {"content-type"=> "application/json"}
|
126
|
+
}
|
98
127
|
).and_return resp
|
128
|
+
subject.perform_request(uri, :post, "/", { body: encoded_body })
|
129
|
+
end
|
99
130
|
|
100
|
-
|
101
|
-
|
131
|
+
it 'encodes body before signing to match manticore adapter encoding' do
|
132
|
+
body = "boîte de réception"
|
133
|
+
encoded_body = body.encode("ISO-8859-1")
|
134
|
+
expect_any_instance_of(Aws::Sigv4::Signer).to receive(:sign_request).with(hash_including({
|
135
|
+
body: body,
|
136
|
+
})).and_return(
|
137
|
+
double(headers: {})
|
138
|
+
)
|
139
|
+
expect(subject.manticore).to receive(:post).
|
140
|
+
with(expected_uri.to_s, {
|
141
|
+
:body => encoded_body,
|
142
|
+
:headers => {"content-type"=> "application/json"}
|
143
|
+
}
|
144
|
+
).and_return resp
|
145
|
+
subject.perform_request(uri, :post, "/", { body: encoded_body })
|
146
|
+
end
|
102
147
|
end
|
103
148
|
end
|
104
149
|
|
@@ -776,6 +776,30 @@ describe LogStash::Outputs::OpenSearch do
|
|
776
776
|
expect(logger).to have_received(:error).with(/Unable to retrieve OpenSearch cluster uuid/i, anything)
|
777
777
|
end
|
778
778
|
|
779
|
+
context 'with iam auth' do
|
780
|
+
context 'es' do
|
781
|
+
let(:options) { { 'hosts' => '127.0.0.1:9999', 'auth_type' => { 'service_name' => 'es' } } }
|
782
|
+
it "logs inability to retrieve uuid" do
|
783
|
+
allow(subject).to receive(:install_template)
|
784
|
+
subject.register
|
785
|
+
subject.send :wait_for_successful_connection
|
786
|
+
|
787
|
+
expect(logger).to have_received(:error).with(/Unable to retrieve OpenSearch cluster uuid/i, anything)
|
788
|
+
end
|
789
|
+
end
|
790
|
+
|
791
|
+
context 'aoss' do
|
792
|
+
let(:options) { { 'hosts' => '127.0.0.1:9999', 'auth_type' => { 'service_name' => 'aoss' } } }
|
793
|
+
it "does not attempt to retrieve uuid" do
|
794
|
+
allow(subject).to receive(:install_template)
|
795
|
+
subject.register
|
796
|
+
subject.send :wait_for_successful_connection
|
797
|
+
|
798
|
+
expect(logger).to_not have_received(:error)
|
799
|
+
end
|
800
|
+
end
|
801
|
+
end
|
802
|
+
|
779
803
|
it "logs template install failure" do
|
780
804
|
allow(subject).to receive(:discover_cluster_uuid)
|
781
805
|
subject.register
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-opensearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -11,9 +11,9 @@ bindir: bin
|
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
14
|
+
MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQsFADBCMRMwEQYDVQQDDApvcGVu
|
15
15
|
c2VhcmNoMRYwFAYKCZImiZPyLGQBGRYGYW1hem9uMRMwEQYKCZImiZPyLGQBGRYD
|
16
|
-
|
16
|
+
Y29tMB4XDTI0MDcyNjIzMjIyN1oXDTI1MDcyNjIzMjIyN1owQjETMBEGA1UEAwwK
|
17
17
|
b3BlbnNlYXJjaDEWMBQGCgmSJomT8ixkARkWBmFtYXpvbjETMBEGCgmSJomT8ixk
|
18
18
|
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM1z3/jcitjV
|
19
19
|
umXwRFn+JSBBd36qZB54Dtucf6+E2fmNPzBRhgYN5XJy/+clQJ9NIJV7C8H52P3V
|
@@ -24,14 +24,14 @@ cert_chain:
|
|
24
24
|
zfR37/NQFkECAwEAAaN9MHswCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
25
25
|
BBYEFJJ2myhLXK742btavNbG0IWrMNBIMCAGA1UdEQQZMBeBFW9wZW5zZWFyY2hA
|
26
26
|
YW1hem9uLmNvbTAgBgNVHRIEGTAXgRVvcGVuc2VhcmNoQGFtYXpvbi5jb20wDQYJ
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
KoZIhvcNAQELBQADggEBAB1D6Ba88KkTApeUl0Iv/WKie1WNi+6o3KQhqqLt+xjB
|
28
|
+
oiBLLdQpKwH7k/TkCmfo9/8lY1sa3Pxckuw2fNVDaVhEHX56fmTUPoOjkyPS4H19
|
29
|
+
YEKFBeY6U1aF7a2piN58j4EcPP7Kv0KD3RlaEwKbYJTiOy/0f5XjWqVYKOS+DrjM
|
30
|
+
EMhX0gWR5oucydDNSi5hkggPYqCZnW9q6yo+k/FW+DK33CeUm69D6elFx7qPGhEx
|
31
|
+
m0rB25J1sO2yjlalRdBoV5p7OKaWG4CGMr+q6vCC2za7yrtZiYOOv+KpWmheTwds
|
32
|
+
P1nbdIL2eAXGfNU3cbtYisS1sSYi7VSkS52pVk8Jgtw=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2024-11-04 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,8 +43,8 @@ dependencies:
|
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: 1.0.0
|
45
45
|
name: manticore
|
46
|
-
prerelease: false
|
47
46
|
type: :runtime
|
47
|
+
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - ">="
|
@@ -63,8 +63,8 @@ dependencies:
|
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '0.0'
|
65
65
|
name: stud
|
66
|
-
prerelease: false
|
67
66
|
type: :runtime
|
67
|
+
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
70
|
- - ">="
|
@@ -83,8 +83,8 @@ dependencies:
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '2.99'
|
85
85
|
name: logstash-core-plugin-api
|
86
|
-
prerelease: false
|
87
86
|
type: :runtime
|
87
|
+
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
90
|
- - ">="
|
@@ -100,8 +100,8 @@ dependencies:
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '1.0'
|
102
102
|
name: logstash-mixin-ecs_compatibility_support
|
103
|
-
prerelease: false
|
104
103
|
type: :runtime
|
104
|
+
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
@@ -114,8 +114,8 @@ dependencies:
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '3'
|
116
116
|
name: aws-sdk
|
117
|
-
prerelease: false
|
118
117
|
type: :runtime
|
118
|
+
prerelease: false
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
@@ -131,8 +131,8 @@ dependencies:
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '2'
|
133
133
|
name: json
|
134
|
-
prerelease: false
|
135
134
|
type: :runtime
|
135
|
+
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
138
|
- - ">="
|
@@ -148,8 +148,8 @@ dependencies:
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
name: logstash-codec-plain
|
151
|
-
prerelease: false
|
152
151
|
type: :development
|
152
|
+
prerelease: false
|
153
153
|
version_requirements: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
155
|
- - ">="
|
@@ -162,8 +162,8 @@ dependencies:
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
name: logstash-devutils
|
165
|
-
prerelease: false
|
166
165
|
type: :development
|
166
|
+
prerelease: false
|
167
167
|
version_requirements: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
169
|
- - ">="
|
@@ -176,8 +176,8 @@ dependencies:
|
|
176
176
|
- !ruby/object:Gem::Version
|
177
177
|
version: '0'
|
178
178
|
name: flores
|
179
|
-
prerelease: false
|
180
179
|
type: :development
|
180
|
+
prerelease: false
|
181
181
|
version_requirements: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
183
|
- - ">="
|
@@ -190,8 +190,8 @@ dependencies:
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0.6'
|
192
192
|
name: cabin
|
193
|
-
prerelease: false
|
194
193
|
type: :development
|
194
|
+
prerelease: false
|
195
195
|
version_requirements: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
197
|
- - "~>"
|
@@ -204,8 +204,8 @@ dependencies:
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '1'
|
206
206
|
name: opensearch-ruby
|
207
|
-
prerelease: false
|
208
207
|
type: :development
|
208
|
+
prerelease: false
|
209
209
|
version_requirements: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
211
|
- - "~>"
|
@@ -231,6 +231,7 @@ files:
|
|
231
231
|
- README.md
|
232
232
|
- RELEASING.md
|
233
233
|
- SECURITY.md
|
234
|
+
- docs/building_custom_docker_images.md
|
234
235
|
- docs/ecs_compatibility.md
|
235
236
|
- lib/logstash/outputs/opensearch.rb
|
236
237
|
- lib/logstash/outputs/opensearch/http_client.rb
|
@@ -307,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
307
308
|
- !ruby/object:Gem::Version
|
308
309
|
version: '0'
|
309
310
|
requirements: []
|
310
|
-
rubygems_version: 3.3.
|
311
|
+
rubygems_version: 3.3.26
|
311
312
|
signing_key:
|
312
313
|
specification_version: 4
|
313
314
|
summary: Stores logs in OpenSearch
|
metadata.gz.sig
CHANGED
Binary file
|