Skip to main content
All CollectionsSIEMCollectorsLinux
How to uninstall Logstash from your Ubuntu collector
How to uninstall Logstash from your Ubuntu collector

The following will remove Logstash along with any associated configurations and dependencies.

Alan Butcher avatar
Written by Alan Butcher
Updated over a month ago

1. Stop Logstash Service

Before uninstalling Logstash, you should stop the Logstash service to ensure that it is not running during the uninstallation process. To stop the service, run the following command:

sudo systemctl stop logstash

2. Uninstall Logstash

Logstash can be uninstalled using the package manager (apt) if it was installed through the official Elastic repository.

sudo apt-get purge logstash

  1. purge removes Logstash along with its configuration files.

  2. If you want to remove only the Logstash package but keep the configuration files, use remove instead of purge:

    sudo apt-get remove logstash

3. Remove Unused Dependencies

After uninstalling Logstash, you may have unused packages and dependencies that were installed with it. To clean up these dependencies, run:

sudo apt-get autoremove

4. Delete Remaining Logstash Configuration Files

If you want to delete any residual configuration files that were not removed during the uninstall process (for example, in /etc/logstash or /var/lib/logstash), you can manually delete these directories:

sudo rm -rf /etc/logstash
sudo rm -rf /var/lib/logstash

5. Remove Logstash Data (Optional)

If you want to delete the data that Logstash may have stored, you can remove the Logstash data directory:

sudo rm -rf /var/log/logstash

That's it, you've removed Logstash from your Linux collector.

Did this answer your question?