A Clean Way to Stop Logstash

Suppose I have an instance of Logstash, but he would like to terminate it in order to change its configs, for example.

How to stop a Logstash instance, ensuring that it finishes sending packets to Elasticsearch? I do not want to lose logs by stopping logstash.

+5
source share
2 answers

Logstash 1.5 resets the pipeline before shutting down in response to a SIGTERM signal, so you can turn it off with the service logstash stop , init.d script, or whatever you usually use.

With Logstash 1.4.x, the SIGTERM signal suddenly disables Logstash, preventing the pipeline from flushing all messages in flight, but you can send SIGINT to force a flash. However, some plugins (for example, the redis input plugin) do not handle this gracefully and hang indefinitely.

+9
source

With Logstash 2.3:

Logstash stores all events in main memory during processing. Logstash responds to SIGTERM, trying to stop the input and waiting for pending events to complete processing before closing.

Source: https://www.elastic.co/guide/en/logstash/2.3/pipeline.html

0
source

All Articles