# Problem with Logstash and Opendistro Elasticsearch

**URL:** <https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265>\
**Category:** General Feedback\
**Created:** [June 18, 2021, 9:47am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265 "2021-06-18T09:47:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThreatInter](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@ThreatInter](https://forum.opensearch.org/u/ThreatInter)\
**Post date:** [June 18, 2021, 9:47am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/1 "2021-06-18T09:47:17Z")

</div>

Hi, community. I tried to write some data to OpenDistro Elasticsearch using logstash.  
This is my Logstash output config:

```auto
output {
    if "_dateparsefailure" not in [tags] and [@metadata][kafka][topic]=="squid_before_logstash" {
        elasticsearch {
            hosts => "hzzp://<es_node>:9200"
            index => "logstash_test_index_%{+YYYY.MM.dd}"
            user => admin
            password => admin
        }
    }
    else if "_dateparsefailure" in [tags] and [@metadata][kafka][topic]=="squid_before_logstash" {
        file {
            path => "/opt/logstash_test/dateparsefailure-%{+YYYY-MM-dd}.txt"
        }
    }
}

```

But I got those errors in Logstash log:

```auto
[2021-06-18T05:39:18,719][ERROR][logstash.outputs.elasticsearch][main] Unable to get license information {:url=>"hzzp://user:password@<elastic_ip>:9200/", :exception=>LogStash::Outputs::ElasticSearch::hzzpClient::Pool::BadRespons
eCodeError, :message=>"Got response code '400' contacting Elasticsearch at URL 'hzzp://<elastic_ip>:9200/_license'"}
[2021-06-18T05:39:18,720][ERROR][logstash.outputs.elasticsearch][main] Could not connect to a compatible version of Elasticsearch {:url=>"hzzp://user:password@<elastic_ip>:9200/"}
[2021-06-18T05:39:21,094][ERROR][logstash.outputs.elasticsearch][main][81dcded0d793f2d1ce54996d7b2accca6703353fa04380b0df10cf210dbf9aa0] Elasticsearch setup did not complete normally, please review previously logged errors {:message=>"No
 Available connections", :exception=>LogStash::Outputs::ElasticSearch::hzzpClient::Pool::NoConnectionAvailableError}
[2021-06-18T05:39:23,722][WARN][logstash.outputs.elasticsearch][main] Restored connection to ES instance {:url=>"hzzp://user:password@<elastic_ip>:9200/"}

```

versions:  
logstash-1:7.13.0-1  
opendistroforelasticsearch-1.13.2-1, Elasticsearch 7.10.2

Also I tried make this settings at logstash.yml

```auto
xpack.monitoring.enabled: false
xpack.management.enabled: false

```

What I am doing wrong? Logstash and Elastic must have same version?  
I replaced http with hzzp, because Forum says me, that I can’t put more than 2 link in my message

---

<div class="post-metadata">

**Author:** ![ThreatInter](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@ThreatInter](https://forum.opensearch.org/u/ThreatInter)\
**Post date:** [June 18, 2021, 10:42am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/2 "2021-06-18T10:42:36Z")

</div>

Elastic and Logstash version must be same

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [June 18, 2021, 3:47pm UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/3 "2021-06-18T15:47:51Z")

</div>

Hey @ThreatInter - this is a known thing. Take a look at the [announcement about Logstash 7.13](https://forum.opensearch.org/t/logstash-7-13-beats-7-13/6036)

---

<div class="post-metadata">

**Author:** ![ssi0202](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@ssi0202](https://forum.opensearch.org/u/ssi0202)\
**Post date:** [August 3, 2021, 8:47am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/4 "2021-08-03T08:47:10Z")

</div>

@searchymcsearchface

to me it looks like that elastic have but a license check in version 7.13 of the OSS \*beats / logstash effectively breaking interoperability with open search.

Looking at how opensearch came about I could see this as a move from elastic to have their OSS versions of \*beats / logstash work with their OSS version of elastic - _only._

what is your position on this? are you going to fork and maintain the \*beats and logstash to in order to ensure support?

here is the pull that i believe is the “move” from elastic  
[https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1005](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1005)  
not being able to keep software updated as possible vunlerabilities arise etc, will in my view keep orgs from using open search, as they will have policies / requirements in place that requires them to keep software updated.

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [August 3, 2021, 1:47pm UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/5 "2021-08-03T13:47:44Z")

</div>

Hey @ssi0202. That’s known and people have been working on it for quite some time. Expect a release of a output plugin for Logstash that works with OpenSearch shortly (possibly today!). In the mean time, you can take a look at the source and build it yourself on github [GitHub - opensearch-project/logstash-output-opensearch: A Logstash plugin that sends event data to a OpenSearch clusters and stores as an index.](https://github.com/opensearch-project/logstash-output-opensearch)

Beats is more complicated - the way beats is put together doesn’t allow for a more graceful solution without drastic moves. However, this seems to only really be an issue when you are using Beats directly connected to OpenSearch, which is possible but not a very typical setup. If you’re using Beats → Logstash → OpenSearch, you should be fine after the output plugin.

---

<div class="post-metadata">

**Author:** ![ssi0202](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@ssi0202](https://forum.opensearch.org/u/ssi0202)\
**Post date:** [August 4, 2021, 7:56am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/6 "2021-08-04T07:56:22Z")

</div>

hi @searchymcsearchface thanks for the quick reply. i will try it out when the plugin is done sounds like its just around the cornor.

so it would still be OSS \*beats → OSS logstash (with the plugin) -\>opensearch correct ?

im not sure i agree with the beats → opensearch is not that widely used, based on my experience, but you most likely have better data on that 😉

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [August 4, 2021, 1:29pm UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/7 "2021-08-04T13:29:06Z")

</div>

Yup. Disclaimer: I’ve not personally used OSS beats → logstash → opensearch, but this is what I’ve been told should work. It’s on my list to write up (look for that soon).

If this is a greenfield project, I’d look at something like Fluentbit instead of Beats. My personal POV is that Fluentbit has a bright future.

WRT beats-\>directly to OpenSearch, I’d like to know more! Do you or someone you know use this setup?

---

<div class="post-metadata">

**Author:** ![thsul](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@thsul](https://forum.opensearch.org/u/thsul)\
**Post date:** [August 16, 2021, 11:52am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/8 "2021-08-16T11:52:29Z")

</div>

Is there any news related to the problem from the beginning?

The logstash oss version was released a few days ago and we tested it within our testing lab, based on all opensearch components.

We also get the following error message, within logstash:

```auto
logstash | [2021-08-16T11:37:26,979][ERROR][logstash.outputs.elasticsearch][main] Unable to get license information {:url=>"https://admin:xxxxxx@xx.xx.xx.xx:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :message=>"Got response code '400' contacting Elasticsearch at URL 'https://xx.xx.xx.xx:9200/_license'"}
logstash | [2021-08-16T11:37:26,979][ERROR][logstash.outputs.elasticsearch][main] Could not connect to a compatible version of Elasticsearch {:url=>"https://admin:xxxxxx@xx.xx.xx.xx:9200/"}

```

Which logstash version should be used with opensearch?

Also opened an bug report [[BUG] Elasticsearch output fail - Could not connect to a compatible version of Elasticsearch · Issue #54 · opensearch-project/logstash-output-opensearch · GitHub](https://github.com/opensearch-project/logstash-output-opensearch/issues/54)

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [August 16, 2021, 4:06pm UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/9 "2021-08-16T16:06:13Z")

</div>

@thsul According to the [documentation](https://opensearch.org/docs/clients/agents-and-ingestion-tools/index/#compatibility-matrix-for-logstash), 7.13.x

---

<div class="post-metadata">

**Author:** ![thsul](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@thsul](https://forum.opensearch.org/u/thsul)\
**Post date:** [August 17, 2021, 5:58am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/10 "2021-08-17T05:58:28Z")

</div>

Thank you. Logstash is working now, the wrong plugin was used. Details can be found in the “issue” on github.

---

<div class="post-metadata">

**Author:** ![godhelpus](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@godhelpus](https://forum.opensearch.org/u/godhelpus)\
**Post date:** [August 19, 2021, 3:55am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/11 "2021-08-19T03:55:21Z")

</div>

Hi @searchymcsearchface  
I tried to downgrade the Logstash version to 7.13.4 OSS build and still no luck connecting to Opendistro Elasticsearch (1.11.0).  
Here’s my logstash config:

```auto
input {
    beats {
        port => 5000
        codec => "json_lines"
    }
}

output {
    elasticsearch {
        ilm_enabled => false
        user => "admin"
        password => "PASSWORD"
        ssl => true
        ssl_certificate_verification => false
        hosts => "https://127.0.0.1:9200"
        index => "test-%{+YYYY.MM.dd}"
        cacert => "/path/to/root-ca.pem"
       }
}

```

I tried this previously on Logstash OSS 7.14.0 and same error.

Error:

```auto
[2021-08-19T03:47:05,246][ERROR][logstash.outputs.elasticsearch][main] Could not connect to a compatible version of Elasticsearch {:url=>"https://admin:xxxxxx@127.0.0.1:9200/"}
[2021-08-19T03:47:10,253][WARN][logstash.outputs.elasticsearch][main] Restored connection to ES instance {:url=>"https://admin:xxxxxx@127.0.0.1:9200/"}
[2021-08-19T03:47:10,265][ERROR][logstash.outputs.elasticsearch][main] Unable to get license information {:url=>"https://admin:xxxxxx@127.0.0.1:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :message=>"Got response code '500' contacting Elasticsearch at URL 'https://127.0.0.1:9200/_license'"}
[2021-08-19T03:47:10,265][ERROR][logstash.outputs.elasticsearch][main] Could not connect to a compatible version of Elasticsearch {:url=>"https://admin:xxxxxx@127.0.0.1:9200/"}

```

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [August 19, 2021, 1:02pm UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/12 "2021-08-19T13:02:21Z")

</div>

Do you have the OpenSearch Output plugin? You’ll need that for any version of either OSS Elasticsearch or OpenSearch.

---

<div class="post-metadata">

**Author:** ![godhelpus](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@godhelpus](https://forum.opensearch.org/u/godhelpus)\
**Post date:** [August 20, 2021, 3:11am UTC](https://forum.opensearch.org/t/problem-with-logstash-and-opendistro-elasticsearch/6265/13 "2021-08-20T03:11:32Z")

</div>

Nope. I did not have.  
However, I installed the plugin and switched config from “elasticsearch” to “opensearch” in the output section and things started to work fine! I also removed the “ilm\_enabled” field.  
Thanks 🙂
