Deploy filebeat in docker using a custom Dockerfile with a entry script


I am deploying my custom config filebeat using docker with the following docker file.


COPY filebeat.yml /usr/share/filebeat/filebeat.yml

USER root

RUN chown filebeat /usr/share/filebeat/filebeat.yml

RUN chmod go-w /usr/share/filebeat/filebeat.yml

COPY /opt/

ENTRYPOINT [ “/opt/” ]

USER filebeat
The /opt/ changes the config file filebeat.yml, add a custom field with a uuid. I need the uuid to attach unique id to each run.
the docker compose creates the filebeat container but the filebeat is not harvesting the log file. When I did a dockers logs on the container, I can see only the console logs and not of the filebeat logs.It seems the filebeat is actually not running.

Hi @Vritti, if you are only changing filebeat.yml it is recommended you do it like this: (either mount or COPY).
You can then use environment variables to set the UUID, check:

@Aahana Thank you …I have been breaking my head. The second option worked.

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