log-viewer icon indicating copy to clipboard operation
log-viewer copied to clipboard

json/jsonl log format support

Open FandaOG opened this issue 3 years ago • 3 comments

Hello,

is it possible to view *.jsonl files? The idea of config file:

format = {
  type: JsonFormat
  charset: UTF-8
  fields: [
    { name: "date", type: "date" },
    { name: "log.level", type: "level/log4j" },
    { name: "server.ip", type: "message" },
    { name: "message", type: "message" },
  ]
}

Thank you.

Fanda

An example:

{"@timestamp":"2021-09-06T07:51:35.894+02:00","message":" 60aa634568a31c4442f2feb29779752e SELECT ID FROM logins WHERE LOGIN = 'xy'","log":{"level":"debug"},"server":{"ip":"172.23.0.2"},"http":{"request":{"method":"POST"}},"trace":{"id":"no-session-lZK"},"user":{"id":-1}}
{"@timestamp":"2021-09-06T07:51:35.894+02:00","message":" 60aa634568a31c4442f2feb29779752e SELECT ID FROM logins WHERE LOGIN = 'xy'","log":{"level":"debug"},"server":{"ip":"172.23.0.2"},"http":{"request":{"method":"POST"}},"trace":{"id":"no-session-lZK"},"user":{"id":-1}}
{"@timestamp":"2021-09-06T07:51:35.894+02:00","message":" 60aa634568a31c4442f2feb29779752e SELECT ID FROM logins WHERE LOGIN = 'xy'","log":{"level":"debug"},"server":{"ip":"172.23.0.2"},"http":{"request":{"method":"POST"}},"trace":{"id":"no-session-lZK"},"user":{"id":-1}}

FandaOG avatar Sep 17 '21 09:09 FandaOG

It's impossible now, but I'll implement it sometimes.

sevdokimov avatar Sep 17 '21 10:09 sevdokimov

I would like this feature - or perhaps someway to feed in our own node/js formatter as middleware - such as pino-pretty: https://github.com/pinojs/pino-pretty#options would be awesome - not sure the lift that would take

nklisch avatar Nov 14 '22 02:11 nklisch