Delete all messages in Graylog

Solution

As it turns out, there were two issues:

  • the command in the tutorial for the elasticsearch docker does not expose the container’s port
  • the port I was using (9000) was incorrect, it should be 9200

With this in mind, this is the solution I arrived to:

docker run --name mongo -d mongo:3
docker run --name elasticsearch \
    -p 9200:9200 \
    -e "http.host=0.0.0.0" \
    -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
    -d docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.10
docker run --name graylog --link mongo --link elasticsearch \
    -p 9000:9000 -p 12201:12201 -p 1514:1514 -p 5555:5555 \
    -e GRAYLOG_HTTP_EXTERNAL_URI="http://127.0.0.1:9000/" \
    -d graylog/graylog:3.3

As you can see, the elastic search command now exposes port 9200. With this in mind the following CURL now works as expected:

curl -XDELETE 'http://localhost:9200/*'

WARNING: After deleting all the indices (and therefore all messages) you need to recalculate the indices. This is another topic that is out of the scope of this question.

1 Like