This library is a parser for the logfmt style of logging messages.
level=info msg="Hello there!" foo=3 bar=ok
Parse a single log line into a Hash Table.
(logfmt:parse "level=info msg=\"Hello there!\" foo=3 bar=ok")#<HASH-TABLE :TEST EQUAL :COUNT 4 {12016FB513}>
Numbers are parsed as numbers, but everything else is taken as-is as a string.
(1+ (gethash "foo" (logfmt:parse "level=info msg=\"Hello there!\" foo=3 bar=ok")))4
parse will signal a Condition if parsing failed, but safe-parse will just yield nil.
(logfmt:safe-parse "level=info BAD msg=\"Hello there!\" foo=3 bar=ok")NIL
A fast, compatible way to read the contents of a file into a string.
(length (logfmt:read-file-into-string #p"README.org"))937
You could then run parse across each line.