Skip to content

Instantly share code, notes, and snippets.

@Creatiwww
Created June 18, 2020 23:40
Show Gist options
  • Save Creatiwww/0967f794a4f115cdea9d5c553a47c92c to your computer and use it in GitHub Desktop.
Save Creatiwww/0967f794a4f115cdea9d5c553a47c92c to your computer and use it in GitHub Desktop.
FROM docker.elastic.co/beats/filebeat:7.7.0
# Copy our custom configuration file
COPY filebeat.yml /usr/share/filebeat/filebeat.yml
USER root
RUN chown root:filebeat /usr/share/filebeat/filebeat.yml
RUN mkdir /usr/share/filebeat/dockerlogs
RUN chown -R root /usr/share/filebeat/
RUN chmod -R go-w /usr/share/filebeat/
CMD ./filebeat -e
filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
output.logstash:
hosts: ["logstash:5044"]
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/app.log
tags: ["test-app"]
scan_frequency: 5s
# processors to filter and enhance data before sending it to the configured output
processors:
- add_fields:
target: ''
fields:
service_name: TEST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment