Added logging via Filebeat -> Logstash

This commit is contained in:
2025-10-21 20:33:33 +02:00
parent 20def0ad16
commit 6e2eb8f8e0
7 changed files with 177 additions and 1 deletions

41
filebeat/configmap.yaml Normal file
View File

@@ -0,0 +1,41 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: filebeat-config
namespace: app-notifications
data:
filebeat.yml: |
filebeat.autodiscover:
providers:
- type: kubernetes
node: ${NODE_NAME}
hints.enabled: true
templates:
- condition:
equals:
kubernetes.namespace: "app-notifications"
config:
- type: container
paths:
- /var/log/containers/*_app-notifications_*.log
processors:
- add_kubernetes_metadata:
in_cluster: true
- drop_event:
when:
not:
or:
- regexp:
kubernetes.pod.name: "^backend-.*"
- regexp:
kubernetes.pod.name: "^service-.*"
- regexp:
kubernetes.pod.name: "^mysql-.*"
- regexp:
kubernetes.pod.name: "^rabbitmq-.*"
logging.level: info
output.logstash:
hosts: ["logstash.app-notifications.svc.cluster.local:5044"]