Skip to content

Commit

Permalink
Make filebeat.yml configurable for davrods containers [DHS-1845, DHS-…
Browse files Browse the repository at this point in the history
…1846]
  • Loading branch information
danieltheunissen committed Mar 30, 2022
1 parent 941450e commit 7b0e9bb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ ARG ENV_FILEBEAT_VERSION

RUN wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${ENV_FILEBEAT_VERSION}-x86_64.rpm -O /tmp/filebeat.rpm \
&& rpm -Uvh /tmp/filebeat.rpm
ADD filebeat.yml /etc/filebeat/filebeat.yml
ARG FILEBEAT_CONFIG_FILE
ADD config/${FILEBEAT_CONFIG_FILE} /etc/filebeat/filebeat.yml
RUN chmod go-w /etc/filebeat/filebeat.yml

EXPOSE 80
Expand Down
16 changes: 16 additions & 0 deletions config/filebeat-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
filebeat.inputs:
- type: log
json.keys_under_root: true
json.add_error_key: true
json.overwrite_keys: true
enabled: true
paths:
- /var/log/httpd/apache.access.log
- /var/log/httpd/apache.error.log
tags: ["DAVRODSUPLOAD"]

# Disable filebeat monitoring
logging.metrics.enabled: false

output.logstash:
hosts: ["elk.dh.local:5044"]
File renamed without changes.
2 changes: 1 addition & 1 deletion run-httpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ fi
exec /usr/sbin/apachectl -DFOREGROUND

# this script must end with a persistent foreground process
tail -F /var/log/httpd/access.log /var/log/httpd/error.log |awk '/^==> / {a=substr($0, 5, length-8); next} {print a":"$0}'
tail -F apache.access.log /var/log/httpd/apache.error.log

0 comments on commit 7b0e9bb

Please sign in to comment.