log_format json_analytics escape=json '{'
'"msec": "$msec", ' # request unixtime in seconds with a milliseconds resolution
'"connection": "$connection", ' # connection serial number
'"connection_requests": "$connection_requests", ' # number of requests made in connection
'"pid": "$pid", ' # process pid
'"request_id": "$request_id", ' # the unique request id
'"request_length": "$request_length", ' # request length (including headers and body)
'"remote_addr": "$remote_addr", ' # client IP
'"remote_user": "$remote_user", ' # client HTTP username
'"remote_port": "$remote_port", ' # client port
'"time_local": "$time_local", '
'"time_iso8601": "$time_iso8601", ' # local time in the ISO 8601 standard format
'"request": "$request", ' # full path no arguments if the request
'"request_uri": "$request_uri", ' # full path and arguments if the request
'"args": "$args", ' # args
It feels like there is a feature missing for Json files you would think that we can add file type Json and it would read the whole file instead of individual lines
Personally I always consider each log line to be an individual unit (with the exception of stack traces). While it’s probably a relatively easy feature to implement and I can’t really think of any hard reason against such feature, I do think that having logs be spanned across multiple lines without good reason is a bad practice, and by implementing this feature some users may potentially feel encouraged (or rather not discouraged) to do so.
Agreed. The challenge is that many system generated JSON data is not collapsed. In fact when you think of JSON, you don’t generally think of it as collapsed (see grafana JSON model)
Maybe adding a data/file type parameter feature of json would inform the process to read not as individual lines but as a whole
Or a feature that collapses the JSON data when reading it