How to Auto-Reload Logstash Configuration

Better Stack Team
Updated on April 5, 2024

To enable Logstash to detect and reload the configuration file automatically, you can use the --config.reload.automatic option when starting Logstash. Here's how to activate it.

When launching Logstash, include the --config.reload.automatic flag in your command:

 
bin/logstash -f <path-to-logstash-conf>.config --config.reload.automatic

If you've followed our installation guide, your command might look like:

 
sudo -u logstash /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf --config.reload.automatic

The option tells Logstash to periodically check the configuration file for any changes, typically every 3 seconds by default. To adjust the frequency of these checks, use the config.reload.interval <interval> option, substituting <interval> with the desired time frame in seconds.

If Logstash is already running without the --config.reload.automatic option, you can force a configuration file to reload by sending a SIGHUP (signal hangup) to the Logstash process:

 
kill -SIGHUP <25473>

Replace the <25473> with the actual process ID of your Logstash instance.

To learn more about Logstash, check out our comprehensive guide. It provides detailed insights into collecting, transforming, and forwarding logs to various destinations.

Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Make your mark

Join the writer's program

Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.

Write for us
Writer of the month
Marin Bezhanov
Marin is a software engineer and architect with a broad range of experience working...
Build on top of Better Stack

Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.

community@betterstack.com

or submit a pull request and help us build better products for everyone.

See the full list of amazing projects on github