From a19dcde18f2bd18652afddf31a66eeb9b889bdd2 Mon Sep 17 00:00:00 2001 From: Karen Metts Date: Wed, 17 Feb 2021 18:28:01 -0500 Subject: [PATCH 1/4] Doc: Add space-delimited URI example --- docs/index.asciidoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 729926d..18cdb40 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -267,6 +267,22 @@ fields => { List of elasticsearch hosts to use for querying. +**Examples** +``` +Add examples here +``` + +{ls} 7.9 and later supports defining an environment variable `hosts => +'${ES_HOSTS}' with multiple whitespace delimited URIs. +This plugin automatically expands `hosts` strings that contain multiple +white-space delimited URs into separate entries. + +**Example** +``` +ES_HOSTS="es1.example.com es2.example.com:9201 es3.example.com:9201" +``` + + [id="plugins-{type}s-{plugin}-index"] ===== `index` From 610550ed666a3aa6c909c4fc89844a26adfed1bf Mon Sep 17 00:00:00 2001 From: Joao Duarte Date: Wed, 3 Mar 2021 10:52:46 +0000 Subject: [PATCH 2/4] [tests] change super to super() - jruby/jruby#6571 --- spec/filters/elasticsearch_spec.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/filters/elasticsearch_spec.rb b/spec/filters/elasticsearch_spec.rb index 0737e1b..f1c075d 100644 --- a/spec/filters/elasticsearch_spec.rb +++ b/spec/filters/elasticsearch_spec.rb @@ -313,7 +313,7 @@ 'sample:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJGFjMzFlYmI5MDI0MTc3MzE1NzA0M2MzNGZkMjZmZDQ2OjkyNDMkYTRjMDYyMzBlNDhjOGZjZTdiZTg4YTA3NGEzYmIzZTA6OTI0NA==' end - let(:config) { super.merge({ 'cloud_id' => valid_cloud_id }) } + let(:config) { super().merge({ 'cloud_id' => valid_cloud_id }) } it "should set host(s)" do plugin.register @@ -328,7 +328,7 @@ end context 'invalid' do - let(:config) { super.merge({ 'cloud_id' => 'invalid:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlv' }) } + let(:config) { super().merge({ 'cloud_id' => 'invalid:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlv' }) } it "should fail" do expect { plugin.register }.to raise_error LogStash::ConfigurationError, /cloud_id.*? is invalid/ @@ -336,7 +336,7 @@ end context 'hosts also set' do - let(:config) { super.merge({ 'cloud_id' => valid_cloud_id, 'hosts' => [ 'localhost:9200' ] }) } + let(:config) { super().merge({ 'cloud_id' => valid_cloud_id, 'hosts' => [ 'localhost:9200' ] }) } it "should fail" do expect { plugin.register }.to raise_error LogStash::ConfigurationError, /cloud_id and hosts/ @@ -345,7 +345,7 @@ end if LOGSTASH_VERSION > '6.0' describe "cloud.auth" do - let(:config) { super.merge({ 'cloud_auth' => LogStash::Util::Password.new('elastic:my-passwd-00') }) } + let(:config) { super().merge({ 'cloud_auth' => LogStash::Util::Password.new('elastic:my-passwd-00') }) } it "should set authorization" do plugin.register @@ -356,7 +356,7 @@ end context 'invalid' do - let(:config) { super.merge({ 'cloud_auth' => 'invalid-format' }) } + let(:config) { super().merge({ 'cloud_auth' => 'invalid-format' }) } it "should fail" do expect { plugin.register }.to raise_error LogStash::ConfigurationError, /cloud_auth.*? format/ @@ -364,7 +364,7 @@ end context 'user also set' do - let(:config) { super.merge({ 'cloud_auth' => 'elastic:my-passwd-00', 'user' => 'another' }) } + let(:config) { super().merge({ 'cloud_auth' => 'elastic:my-passwd-00', 'user' => 'another' }) } it "should fail" do expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Multiple authentication options are specified/ @@ -374,7 +374,7 @@ describe "api_key" do context "without ssl" do - let(:config) { super.merge({ 'api_key' => LogStash::Util::Password.new('foo:bar') }) } + let(:config) { super().merge({ 'api_key' => LogStash::Util::Password.new('foo:bar') }) } it "should fail" do expect { plugin.register }.to raise_error LogStash::ConfigurationError, /api_key authentication requires SSL\/TLS/ @@ -382,7 +382,7 @@ end context "with ssl" do - let(:config) { super.merge({ 'api_key' => LogStash::Util::Password.new('foo:bar'), "ssl" => true }) } + let(:config) { super().merge({ 'api_key' => LogStash::Util::Password.new('foo:bar'), "ssl" => true }) } it "should set authorization" do plugin.register @@ -393,7 +393,7 @@ end context 'user also set' do - let(:config) { super.merge({ 'api_key' => 'foo:bar', 'user' => 'another' }) } + let(:config) { super().merge({ 'api_key' => 'foo:bar', 'user' => 'another' }) } it "should fail" do expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Multiple authentication options are specified/ @@ -404,7 +404,7 @@ describe "proxy" do context 'valid' do - let(:config) { super.merge({ 'proxy' => 'http://localhost:1234' }) } + let(:config) { super().merge({ 'proxy' => 'http://localhost:1234' }) } it "should set proxy" do plugin.register @@ -416,7 +416,7 @@ end context 'invalid' do - let(:config) { super.merge({ 'proxy' => '${A_MISSING_ENV_VAR:}' }) } + let(:config) { super().merge({ 'proxy' => '${A_MISSING_ENV_VAR:}' }) } it "should not set proxy" do plugin.register From 9e311dfdbc3f9814947adae0cbd11c27a2b7f29f Mon Sep 17 00:00:00 2001 From: Karen Metts Date: Wed, 17 Feb 2021 18:28:01 -0500 Subject: [PATCH 3/4] Doc: Add space-delimited URI example --- docs/index.asciidoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 729926d..18cdb40 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -267,6 +267,22 @@ fields => { List of elasticsearch hosts to use for querying. +**Examples** +``` +Add examples here +``` + +{ls} 7.9 and later supports defining an environment variable `hosts => +'${ES_HOSTS}' with multiple whitespace delimited URIs. +This plugin automatically expands `hosts` strings that contain multiple +white-space delimited URs into separate entries. + +**Example** +``` +ES_HOSTS="es1.example.com es2.example.com:9201 es3.example.com:9201" +``` + + [id="plugins-{type}s-{plugin}-index"] ===== `index` From 5fe8762b0080ca6eb251ffb46c15ac54fe0deb2e Mon Sep 17 00:00:00 2001 From: Karen Metts Date: Wed, 11 Aug 2021 17:20:40 -0400 Subject: [PATCH 4/4] Refine content and examples --- docs/index.asciidoc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 18cdb40..ac8d148 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -267,21 +267,15 @@ fields => { List of elasticsearch hosts to use for querying. -**Examples** -``` -Add examples here -``` +This option can accept an environment variable containing one or more hostnames separated by whitespace. +Strings separated by whitespace are treated as separate entries. -{ls} 7.9 and later supports defining an environment variable `hosts => -'${ES_HOSTS}' with multiple whitespace delimited URIs. -This plugin automatically expands `hosts` strings that contain multiple -white-space delimited URs into separate entries. - -**Example** -``` -ES_HOSTS="es1.example.com es2.example.com:9201 es3.example.com:9201" -``` +*Examples:* +* `ES_HOSTS="es1.example.com es2.example.com:9201 es3.example.com:9201"` +* `ES_HOSTS="127.0.0.1:9200 127.0.0.2:9200"` +* `ES_HOSTS="http://127.0.0.1 http://127.0.0.2"` +* `ES_HOSTS="https://127.0.0.1:9200/mypath https://127.0.0.2:9200/mypath"` [id="plugins-{type}s-{plugin}-index"] ===== `index`