Skip to content

Commit 0bb811c

Browse files
Better document in_tail's need for read permission
- Clarify that td-agent is *default* user of process - Describe that cap_dac_read_search may also be used in addition to usermod Related: - fluent/fluentd#3525 - fluent/fluentd#3478 Signed-off-by: Brad Solomon <81818815+brsolomon-deloitte@users.noreply.github.com>
1 parent 9119dfa commit 0bb811c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

input/tail.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,17 @@ If you see this message:
417417
418418
It means that `fluentd` does not have read permission for `/path/to/file`. Check your fluentd and target files permission.
419419

420+
**Note**: When `td-agent` is launched by systemd, the default user of the `td-agent` process is the `td-agent` user.
421+
You must ensure that this user has read permission to the tailed `/path/to/file`. For instance, on Ubuntu,
422+
the default Nginx access file `/var/log/nginx/access.log` is mode `0640` and owned by `www-data:adm`. In
423+
this case, several options are available to allow read access:
424+
425+
1. Add the `td-agent` user to the `adm` group, e.g. through `usermod -aG`, or
426+
2. Use the [`cap_dac_read_search` capability](../deployment/linux-capability#capability-handling-on-in_tail)
427+
to allow the invoking user to read the file without otherwise changing its permission bits or ownership.
428+
429+
A bug exists in Fluentd 1.13.x where it may suppress warning logs about unreadable files. (See Fluentd PR [#3478](https://github.com/fluent/fluentd/pull/3478).)
430+
420431
### `logrotate` Setting
421432

422433
`logrotate` has the `nocreate` parameter and it does not create a new file if log rotation is triggered. It means `in_tail` cannot find the new file to tail.

parser/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ Here is an example to read Nginx access logs using `in_tail` and `parser_nginx`:
4141
</source>
4242
```
4343

44+
**Note**: When `td-agent` is launched by systemd, the default user of the `td-agent` process is the `td-agent` user.
45+
You must ensure that this user has read permission to the tailed `/path/to/file`. For instance, on Ubuntu,
46+
the default Nginx access file `/var/log/nginx/access.log` is mode `0640` and owned by `www-data:adm`. In
47+
this case, several options are available to allow read access:
48+
49+
1. Add the `td-agent` user to the `adm` group, e.g. through `usermod -aG`, or
50+
2. Use the [`cap_dac_read_search` capability](../deployment/linux-capability#capability-handling-on-in_tail)
51+
to allow the invoking user to read the file without otherwise changing its permission bits or ownership.
52+
4453
## List of Built-in Parsers
4554

4655
* [`regexp`](regexp.md)

0 commit comments

Comments
 (0)