Skip to content

Instantly share code, notes, and snippets.

@altmas5
Forked from huksley/graylog2-wipe.sh
Created December 28, 2017 18:16
Show Gist options
  • Save altmas5/30ddc6c975cf2e135b6fb7b358c33eed to your computer and use it in GitHub Desktop.
Save altmas5/30ddc6c975cf2e135b6fb7b358c33eed to your computer and use it in GitHub Desktop.
Clean all data in graylog2 without deleting settings, with full restart
#!/bin/sh
systemctl stop elasticsearch.service
systemctl stop graylog-server.service
rm -rf /var/lib/elasticsearch/nodes/0/indices/*
# IF YOU HAVE AUTH USE THIS LINE - mongo graylog2 --eval "db.auth('graylog2', 'PASSWORD'); db.message_counts.remove();"
mongo graylog2 --eval "db.message_counts.remove();"
systemctl start elasticsearch.service
systemctl start graylog-server.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment