Fluentbit Kubernetes - How to extract fields from existing logs Fluentbit Kubernetes - How to extract fields from existing logs kubernetes kubernetes

Fluentbit Kubernetes - How to extract fields from existing logs


In our official documentation for Kubernetes filter we have an example about how to make your Pod suggest a parser for your data based in an annotation:

https://docs.fluentbit.io/manual/filter/kubernetes


Look at this configmap:

https://github.com/fluent/fluent-bit-kubernetes-logging/blob/master/output/elasticsearch/fluent-bit-configmap.yaml

The nginx parser should be there:

[PARSER]        Name   nginx        Format regex        Regex ^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$        Time_Key time        Time_Format %d/%b/%Y:%H:%M:%S %z