# Logstash elasticsearch output plugin: configure retry count

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-configure-retry-count/121472>\
**Category:** Logstash\
**Created:** [February 26, 2018, 10:51am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-configure-retry-count/121472 "2018-02-26T10:51:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ov7a](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@ov7a](https://discuss.elastic.co/u/ov7a)\
**Post date:** [February 26, 2018, 10:51am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-configure-retry-count/121472/1 "2018-02-26T10:51:45Z")

</div>

My configuration is the following  
java app =\> log4j2 SocketAppender (tcp) =\> Logstash: tcp input, es output =\> elasticsearch

Scenario:  
Elasticsearch cluster is red and do not accept indexing by some reason.

Current behavior:  
Logstash infinitely retries to index log into elasticsearch. Log4j2 waits for it and the java app simply hangs.

Desired behavior:  
Logstash should retry, say, 5 times and then just reply to log4j2 with error somehow. Log4j2 throws an error =\> it can be logged in file and further investigated.

Is there an option to limit retry count for es output plugin?

---

<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:** [March 26, 2018, 10:52am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-configure-retry-count/121472/2 "2018-03-26T10:52:23Z")

</div>

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