Can Filebeat access certs within a docker container?

Hi, we are currently running an application on a server through Docker. Unfortunately, the certs and logs are within the container itself.
When setting up Filebeat, I was wondering if there was a way to access those certs inside docker. I do know that Filebeat can access logs within docker (Container input | Filebeat Reference [8.4] | Elastic).

Hey @userR, welcome to discuss :slight_smile:

If you expect other containers, like the Filebeat one, to access the logs and certifiactes of your application, your application should expose these files in some volume. Then you need to mount this volume in filebeat.

Another approach would be to include filebeat in the same container as your application, though I wouldn't recommend that, unless the container of your application is already a heavy container with several processes.

To use the container input, your application should be logging to standard output or error, so their logs are exposed by docker and can be collected by other processes, as docker logs does.

Hi! Just to clarify, I am not running Filebeat through a container, rather the application is running in one with certs inside the container.

So it looks like the only other option is to either bind-mount these certs into our applications container, or run filebeat and the application in the same container?

Yes, you would need to mount a directory in the container that filebeat can see, or run filebeat in the same container.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.