Skip to content

Instantly share code, notes, and snippets.

@orihomie
Created September 12, 2022 05:22
Show Gist options
  • Save orihomie/1e02eb3ebc580bd4b9d122adb0eef8af to your computer and use it in GitHub Desktop.
Save orihomie/1e02eb3ebc580bd4b9d122adb0eef8af to your computer and use it in GitHub Desktop.
Filebeat json message parsing sample
filebeat.inputs:
- type: docker
combine_partial: true
tags: ["my-tag-docker"]
containers:
path: "/var/lib/docker/containers"
ids:
- "*"
processors:
- add_docker_metadata:
when:
contains:
tags: "my-tag"
host: "unix:///var/run/docker.sock"
- add_tags:
when:
contains:
container.labels.com_docker_compose_project: container_name
tags: ["my-tag"]
- decode_json_fields:
fields: ["message"]
process_array: false
max_depth: 1
target: ""
overwrite_keys: false
add_error_key: true
output.logstash:
hosts: ["myhost.domain:9005"]
logging.level: debug
logging.to_files: true
logging.files:
path: /var/log/filebeat
name: filebeat
keepfiles: 7
permissions: 0644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment