1
1
Fork 0
exercism/jq/log-line-parser/log-line-parser.jq
Christina Sørensen 0a4ebc2eb6
chore: init
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-12-03 15:51:11 +01:00

7 lines
186 B
Text

def trim: sub("^\\s+"; "") | sub("\\s+$"; "");
def message: sub("^\\[\\w+\\]:"; "")|trim;
def log_level: (. / ":")[0][1:-1]|ascii_downcase;
def reformat: "\(message) (\(log_level))";