Add searchable dashboards with Graylog (Docker)

careful advanced #graylog#docker#search#dashboard#syslog input

When to use this: Plain files are not enough and you want a web UI to search, filter and chart syslog.

Be careful with this one. Graylog needs a database stack and decent RAM. Take compose files and settings from the official docs for the version you install, not from memory or blog posts.

Before you start

Steps

  1. Download the official compose file

    From Graylog's documentation, copy the Docker Compose example for the current release into a folder such as ~/graylog. Do not mix settings from different versions.

  2. Generate the secret and the admin password hash

    terminal
    pwgen -N 1 -s 96
    echo -n 'YourStrongPassword' | sha256sum | cut -d' ' -f1

    The first output is a long random string for the password secret. The second is the SHA-256 of your admin password. Put them in the compose settings the docs name (GRAYLOG_PASSWORD_SECRET and GRAYLOG_ROOT_PASSWORD_SHA2). Install pwgen with sudo apt install pwgen if missing.

  3. Publish a syslog port in the compose file

    Under the Graylog service ports, add a syslog port such as 1514:1514/udp and 1514:1514/tcp. Use 1514 instead of 514 so the container does not need privileged ports. Point devices at 1514, or forward 514 to 1514 with the host firewall.

  4. Start the stack

    terminal
    docker compose up -d
    docker compose logs -f graylog

    Wait until Graylog reports it is running. The first start takes a few minutes.

  5. Create the Syslog input

    In the web UI: System, Inputs, choose 'Syslog UDP' (and 'Syslog TCP' if needed), bind to 0.0.0.0 port 1514, Launch. Open the firewall for 1514 from your senders only.

  6. Point a device at it and search

    Send a test message, then use Search. You should see parsed fields such as source and message. Add streams and dashboards for the logs you care about.

How to verify it worked

  • Search shows messages arriving from the device, with the correct source IP and time.

How to undo it

Stop and remove the containers (add -v only if you also want to delete stored data):

terminal
docker compose down

Common errors and fixes

Containers restart repeatedly or the UI never comes up Usually too little RAM or a missing required setting. Read docker compose logs, compare with the official compose file and requirements.
No messages in Search though the input is running Check that the published port matches the input port, that the host firewall allows it, and watch traffic with sudo tcpdump -ni any port 1514.

Q&A

Is Graylog free?

Graylog Open is described by the vendor as free permanently. Paid Enterprise and Security editions exist. Check current terms.

Why use port 1514 instead of 514?

Ports below 1024 are privileged. Using 1514 avoids running containers with extra privileges, and you can redirect 514 to 1514 on the host if a device cannot change its port.

Practice these as flashcards →

Terms in this scenario

Related scenarios

My notes

Saved in this browser only.