1
1
Fork 0
exercism/jq/log-line-parser/log-line-parser.jq

8 lines
186 B
Text
Raw Normal View History

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