Skip to content

Instantly share code, notes, and snippets.

@gurvinderdadyala
Forked from huksley/graylog2-wipe.sh
Created November 18, 2016 10:18
Show Gist options
  • Select an option

  • Save gurvinderdadyala/ef7fae4748eded77e7284482251d1436 to your computer and use it in GitHub Desktop.

Select an option

Save gurvinderdadyala/ef7fae4748eded77e7284482251d1436 to your computer and use it in GitHub Desktop.
Clean all data in graylog2 without deleting settings, with full restart
#!/bin/sh
service elasticsearch stop
service graylog2-server stop
killall -9 java
service apache2 stop
rm -Rf /opt/elasticsearch/data/*
# 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();"
service elasticsearch start
service graylog2-server start
service apache2 start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment