Creating shared volume between my rest application and Filebeat

Hi,

I have a java application running on Docker. It is writing logs that Filebeat would be reading. The Filebeat is also running on Docker.

So what I understand is that we need to create a shared volume where Java application will put its logs and Filebeat will read it from the shared volume.
Is my understanding correct?

Also, if yes, then I just need to create a shared volume and in my docker compose file, I need to give the path for both Filebeat and for Java application.

My another question is, with this shared volume it will be understood that Java application will write the logs and Filebeat will read them, right? We need not mention it explicitly.

Regards
Neha Jain

Hi! Yes, running with a volume mount is probably the best way to do it. You don't need to explicitly specify the reader or writer (although you can set the Filebeat mount to read-only), as long as both filebeat and your application know what path to use. Here are some filebeat docker examples.

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