Skip to content

Commit

Permalink
docs: fix example with pulling systemd logs
Browse files Browse the repository at this point in the history
/etc/machine-id must be mounted in the container for promtail to know
which systemd journal to read from.
  • Loading branch information
rfratto committed Sep 10, 2019
1 parent 7343ebf commit 105dbec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/promtail/config-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@ in Loki. All other labels from the journal entry are dropped.
### Example Use

`promtail` must have access to the journal path (`/var/log/journal`)
where journal entries are stored for journal support to work correctly.
where journal entries are stored and the machine ID (`/etc/machine-id`) for
journal support to work correctly.

If running with Docker, that means to bind that path:
If running with Docker, that means to bind those paths:

```bash
docker run -d --name promtail --network loki_network -p 9080:9080 \
-v /var/log/journal:/var/log/journal \
-v /etc/machine-id:/etc/machine-id \
mypromtail-image -config.file=/etc/promtail/my-systemd-journal-config.yaml
```

0 comments on commit 105dbec

Please sign in to comment.