# Logstash: Elasticsearch input plugin doesn't work

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-doesnt-work/247145>\
**Category:** Logstash\
**Created:** [September 1, 2020, 8:09pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-doesnt-work/247145 "2020-09-01T20:09:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor\_Olikh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_olikh/32/46434_2.png) [@Igor\_Olikh](https://discuss.elastic.co/u/Igor_Olikh)\
**Post date:** [September 1, 2020, 8:09pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-doesnt-work/247145/1 "2020-09-01T20:09:00Z")

</div>

It sounds strange (at least for me) that the output plugin works:  
elasticsearch  
{  
hosts =\> ["[https://elastict:9200](https://elastict:9200)"]  
user =\> "elastic"  
password =\> "PASSWORD"  
ssl =\> true  
ssl\_certificate\_verification =\> true  
cacert =\> "/etc/logstash/conf.d/certs/sub\_ca.crt"  
index =\> "indexname-%{+YYYY.MM.dd}"  
}

but when I try to use input plugin:  
elasticsearch {  
hosts =\> "[https://elastict:9200](https://elastict:9200)"  
user =\> "elastic"  
password =\> "PASSWORD"  
ssl =\> true  
ca\_file =\> "/etc/logstash/conf.d/certs/sub\_ca.crt"  
index =\> "indexname"  
}

I get the error: Failed to open TCP connection to https:0 (initialize: name or service not known)

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [September 1, 2020, 9:15pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-doesnt-work/247145/2 "2020-09-01T21:15:34Z")

</div>

Compare the [input](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-elasticsearch.html#plugins-inputs-elasticsearch-hosts) and [output](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts). They require different data and different formats.

Try `hosts => ["elastict:9200"]` in your input.

---

<div class="post-metadata">

**Author:** ![Igor\_Olikh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_olikh/32/46434_2.png) [@Igor\_Olikh](https://discuss.elastic.co/u/Igor_Olikh)\
**Post date:** [September 2, 2020, 7:09am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-doesnt-work/247145/3 "2020-09-02T07:09:59Z")

</div>

Thank you Aaron. It changed the exception. Now I get "Certificate verify failed". I use the same certificate like in the output plugin. Should they be different?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [September 2, 2020, 4:51pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-doesnt-work/247145/4 "2020-09-02T16:51:25Z")

</div>

The output [accepts](https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/8804933e2b15d867a049319e52ee61223552b6be/lib/logstash/outputs/elasticsearch.rb#L164) a .cer or .pem cert, the input [requires](https://github.com/logstash-plugins/logstash-input-elasticsearch/blob/f79f47d863741049849507ef21515acd5e653274/lib/logstash/inputs/elasticsearch.rb#L168) a pem encoded cert.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 30, 2020, 4:51pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-doesnt-work/247145/5 "2020-09-30T16:51:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
