How to make stdout plugin not send to td-agent.log when using td-agent.

490 views
Skip to first unread message

Tim Zabel

unread,
Oct 2, 2018, 3:08:12 PM10/2/18
to Fluentd Google Group
For my use-case, I need to use td-agent through the RPM package. I am running this through a docker container, and need the logs to be readable through `docker logs`.

Question: Is there any way to send output to actual standard out, instead of the td-agent.log file when running td-agent through systemd?

Command to run: `systemctl start td-agent`.

Dummy config file below:

```
<source>
  @type tail
  @id input_tail
  format <format>
  path /path/to/access.log
  pos_file /path/to/access.log.pos
  tag docker.*
</source>

<match docker.**>
  @type stdout
</match>
```

Mr. Fiber

unread,
Oct 2, 2018, 4:41:27 PM10/2/18
to Fluentd Google Group
You can use stdout instead of log file by removing --log option from this ExecStart


I'm not familiar with systemd deeply so I'm not sure how to get systemd managed stdout log from 'docker logs'.


Masahiro

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Zabel

unread,
Oct 2, 2018, 4:56:45 PM10/2/18
to flu...@googlegroups.com
Thanks for the help!

Sadly, I have tried removing the `--log` option, but it still does not redirect to standard out :/


Mr. Fiber

unread,
Oct 3, 2018, 8:46:53 AM10/3/18
to Fluentd Google Group
Does it mean jounald can't capture td-agent stdout log?

Tim Zabel

unread,
Oct 3, 2018, 10:27:17 AM10/3/18
to flu...@googlegroups.com
Yes, journalctl cannot capture td-agent stout log.
It is able to capture the initial startup of td-agent up to "Started td-agent...", but I am unable to view any output of parsed logs after that point.

Any ideas?

Tim Zabel

unread,
Oct 3, 2018, 11:17:17 AM10/3/18
to flu...@googlegroups.com
So, as an update, I am now able to get log output into journalctl. However, docker still cannot pick up the logs.

Will continue investigating.

Tim Zabel

unread,
Oct 3, 2018, 2:34:10 PM10/3/18
to flu...@googlegroups.com
As a final update, I ended up getting this all to work.

I took out all the systemd environment variables and put them into the Dockerfile.
Then, I grabbed only the fluentd exec file, and put that into the CMD.

At this point, I got rid of the systemd service file and ran td-agent from the standalone script. This gives the output necessary for `docker logs`.

Thanks for the help!
Reply all
Reply to author
Forward
0 new messages