# Logstash elasticsearch output plugin hangs at health check

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-hangs-at-health-check/77040>\
**Category:** Logstash\
**Created:** [March 1, 2017, 7:27pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-hangs-at-health-check/77040 "2017-03-01T19:27:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![addyk](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@addyk](https://discuss.elastic.co/u/addyk)\
**Post date:** [March 1, 2017, 7:27pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-hangs-at-health-check/77040/1 "2017-03-01T19:27:16Z")

</div>

I am using a Logstash ver 5.2 docker image and outputting to Elastic Cloud with ver 5.1.2. The appropriate environment variables have been set to correspond with my output.

```auto
output {
  stdout { codec => rubydebug }

  elasticsearch {
    hosts => ["${ELASTICSEARCH_HOST}"]
    user => "${ELASTIC_CLOUD_USER}"
    password => "${ELASTIC_CLOUD_PASSWORD}"
    index => "%{level}-%{+YYYY.MM.dd}"
    document_type => "logs"
  }
}

```

If I comment out the elasticsearch output, then I am able to see stdout. Stdout indicates that my filters and input are coming in fine. However, if I leave the elasticsearch plugin enabled, then I get the following logs:

```auto
 Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties
 19:21:31.746 [main] INFO logstash.setting.writabledirectory - Creating directory {:setting=>"path.queue", :path=>"/usr/share/logstash/data/queue"}
 19:21:31.796 [LogStash::Runner] INFO logstash.agent - No persistent UUID file found. Generating new UUID {:uuid=>"3715cecd-0db2-4a64-ac9d-c0c479fb085c", :path=>"/var/lib/logstash/uuid"}
 19:21:36.700 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[https://username:password@b40c2d46d42bf8d09ffce40c191409fc.us-east-1.aws.found.io:9243/]}}
 19:21:36.719 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>https://username:password@b40c2d46d42bf8d09ffce40c191409fc.us-east-1.aws.found.io:9243/, :path=>"/"}

```

On some days, I will actually see stdout with elasticsearch plugin enabled, but on other days without any change, I will get no other output from the "Running health check" line.

Edit: Removed my filters temporarily to confirm that it wasn't anything going on the filters end.

---

<div class="post-metadata">

**Author:** ![addyk](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@addyk](https://discuss.elastic.co/u/addyk)\
**Post date:** [March 20, 2017, 5:20pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-hangs-at-health-check/77040/2 "2017-03-20T17:20:56Z")

</div>

Also want to point out that these two users are having similar issue (not being able to send data from logstash to elastic)

> [@Logstash not sending data to elastic from kafka](https://discuss.elastic.co/t/logstash-not-sending-data-to-elastic-from-kafka/78866):
>
> Hi, im trying to add data in elastic with logstash and data is input from kafka this is the simple config im using on logstash server in conf file /etc/logstash/conf.d/1-config.conf input{ kafka{ bootstrap\_servers =\> "dummykafka:9092" topics =\> ["dummy.kafka.topic"] } } output{ elasticsearch{ index =\> "test.winlogbeat.eventlogs-%{+YYYY.MM.dd}" hosts =\> ["elasticdatanode:50000"] user =\> "AdminID" password =\> "dummypassword" } } i restart the logstash server with this command sud…

> [@I cant put logs in elasticsearch from logstash](https://discuss.elastic.co/t/i-cant-put-logs-in-elasticsearch-from-logstash/79068):
>
> Im using logstash 1.4.2 and ... slight_smile I have the next logstash.conf input { udp { port =\> 9991 codec =\> netflow { definitions =\> "/home/profucom/logstash-1.4.2/lib/logstash/codecs/netflow/netflow.yaml" versions =\> [5] } } } output { stdout { codec =\> rubydebug } elasticsearch { index =\> logstash-%{+YYYY.MM.dd} host =\> "localhost" } } When i run "./logstash -f logstash.conf works fine, i get all information from my 2 routers, but im not sure if index =\> logstash-%{+Y…

Edit: To clarify, I do not have the password error like that mentioned in [Pipeline aborted due to error in password field logstash](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-in-password-field-logstash/68975)

---

<div class="post-metadata">

**Author:** ![addyk](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@addyk](https://discuss.elastic.co/u/addyk)\
**Post date:** [March 20, 2017, 6:24pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-hangs-at-health-check/77040/3 "2017-03-20T18:24:52Z")

</div>

I was able to fix my issue by creating a logstash.yml with the following configuration:

```auto
node:
  name: ${HOSTNAME}
xpack:
  monitoring:
    enabled: false
    elasticsearch:
      url: ${ELASTICSEARCH_HOST}
      username: ${ELASTIC_CLOUD_USER}
      password: ${ELASTIC_CLOUD_PASSWORD}

```

I also upgraded to use [docker.elastic.co](http://docker.elastic.co) logstash 5.2.2 image.

---

<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:** [April 17, 2017, 6:24pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-hangs-at-health-check/77040/4 "2017-04-17T18:24:55Z")

</div>

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