Last active
September 22, 2023 20:29
-
-
Save andrewkroh/cc78673329903ebd8bdc509bae689bb6 to your computer and use it in GitHub Desktop.
Filebeat - processing kubelet json logs read from journald
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filebeat.inputs: | |
- type: journald | |
processors: | |
# For https://kubernetes.io/docs/concepts/cluster-administration/system-logs/#json-log-format | |
- if: | |
and: | |
- equals.journald.process.name: kubelet | |
- regexp.message: '^{' | |
then: | |
# 'kubelet' should be mapped as a flattened field in ES because | |
# it can have arbitrary keys and value types. | |
- decode_json_fields: | |
fields: | |
- message | |
target: kubelet | |
- convert: | |
mode: rename | |
fields: | |
- { from: kubelet.msg, to: message } | |
- { from: kubelet.v, to: log.level, type: "string" } | |
- timestamp: | |
field: kubelet.ts | |
layouts: | |
- UNIX | |
test: | |
- '1580306777.04728' | |
- drop_fields: | |
fields: | |
- kubelet.ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment