fluent / fluent-bit

Fast and Lightweight Logs and Metrics processor for Linux, BSD, OSX and Windows
https://fluentbit.io
Apache License 2.0
5.77k stars 1.57k forks source link

[Feature Request] Add logfmt to decoder #1289

Open grigorov opened 5 years ago

grigorov commented 5 years ago

In flb_parser_decoder.c only support decoder: json, escaped, escaped_utf8

I need add logfmt (flb_parser_logfmt.c) to decode simple json:

{ "log": "a=b c=d" } need get key a=>b, c=>d. If I use parser logfmt for json string, i get in stdout:

My stdout: [OUTPUT] Name stdout Match * Format json_lines json_date_key time json_date_format iso8601 my output: {"time":"2019-04-19T16:15:04.000000Z", "{":true, "log":true, ":":true, "a":"b", "c":"d", "}":true}

Please help with add logfmt in decoder...

GaoyangWang commented 5 years ago

I like this requirement. Because I also face such interesting log format. Partially it is logfmt.

edsiper commented 5 years ago

for a parser it's already there:

https://github.com/fluent/fluent-bit-docs/blob/master/parser/logfmt.md

note: but not for decoders

gabegorelick commented 3 years ago

Kubernetes structured logging uses a form of logfmt. Decoder support would be nice so that you don't need a separate parser filter.