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

(Vivek Thangathurai) #1

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.

(Carlos PĂ©rez Aradros) #2

Hi @vivekthangathurai, 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:

(Vivek Thangathurai) #3

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

(system) #4

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