benhoyt / goawk

A POSIX-compliant AWK interpreter written in Go, with CSV support

Home Page:https://benhoyt.com/writings/goawk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add logfmt support

dloss opened this issue · comments

GoAWK could be useful for analyzing structured log messages in "logfmt" format (key=value or key="value" pairs).
https://brandur.org/logfmt

Syntax for referencing fields could be the same as for CSV.

Hi @dloss, thanks for the suggestion. I probably won't add this directly, because logfmt is not particularly standardized or super well-used. I'm thinking of adding JSON support, because JSON is so widely-used (including for structured logging), so probably the best way to achieve this is a simple program that converts logfmt to JSON lines and then use that output (for a future GoAWK that actually supports JSON).

I've you'd like to open a separate issue for JSON Lines support to track that, I'd be happy to work with you on designing that.