Skip to content

Instantly share code, notes, and snippets.

@VerosK
Created April 11, 2020 19:41
Show Gist options
  • Save VerosK/5441da34c2ee130c929a44d71d05d919 to your computer and use it in GitHub Desktop.
Save VerosK/5441da34c2ee130c929a44d71d05d919 to your computer and use it in GitHub Desktop.
Filebeat in kubernetes
filebeat.inputs:
- type: container
paths:
- /var/log/containers/*.log
processors:
- add_kubernetes_metadata:
in_cluster: true
host: ${NODE_NAME}
matchers:
- logs_path:
logs_path: "/var/log/containers/"
- decode_json_fields:
when:
and:
- regexp:
message: ' *\{.*\} *'
- equals:
"kubernetes.container.name": nginx-ingress-controller
fields: ["message"]
max_depth: 1
target: ""
overwrite_keys: true
add_error_key: true
output.elasticsearch:
hosts: ['elasticsearch.services:9200']
protocol: http
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment