Implemented sending logs to ElasticSearch with Filebeat (#125)

Co-authored-by: Adam Bem <adam.bem@zoho.eu>
Reviewed-on: #125
This commit is contained in:
2023-03-21 09:47:28 +01:00
parent bd565ffd7d
commit 0bd80b1878
3 changed files with 37 additions and 0 deletions

2
Filebeat/Dockerfile Normal file
View File

@@ -0,0 +1,2 @@
FROM docker.elastic.co/beats/filebeat:8.6.2
COPY --chown=root:filebeat filebeat.docker.yml /usr/share/filebeat/filebeat.yml

View File

@@ -0,0 +1,21 @@
filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
filebeat.autodiscover:
providers:
- type: docker
hints.enabled: true
processors:
- add_cloud_metadata: ~
output.elasticsearch:
hosts: '${ELASTICSEARCH_HOSTS:elc-0.zipper.release11.com:9200}'
index: 'xmltools-${ENV_TYPE:dev}-%{+YYYY.MM}'
setup.template:
name: "xmltools"
pattern: "xmltools-*"

View File

@@ -50,6 +50,20 @@ services:
volumes: volumes:
- ./Swagger:/Swagger - ./Swagger:/Swagger
filebeat:
build: ./Filebeat
container_name: xmltools-filebeat
user: root
volumes:
- "./Filebeat/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro"
- "/var/lib/docker/containers:/var/lib/docker/containers:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
environment:
- ENV_TYPE
command:
- "-e"
- "--strict.perms=false"
networks: networks:
default: default:
name: tools_network name: tools_network