diff options
Diffstat (limited to 'doc/administration/troubleshooting/log_parsing.md')
-rw-r--r-- | doc/administration/troubleshooting/log_parsing.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/administration/troubleshooting/log_parsing.md b/doc/administration/troubleshooting/log_parsing.md index 25300d036ed..2900ce58940 100644 --- a/doc/administration/troubleshooting/log_parsing.md +++ b/doc/administration/troubleshooting/log_parsing.md @@ -41,6 +41,20 @@ jq -cR 'fromjson?' file.json | jq <COMMAND> By default `jq` will error out when it encounters a line that is not valid JSON. This skips over all invalid lines and parses the rest. +#### Print a JSON log's time range + +```shell +cat log.json | (head -1; tail -1) | jq '.time' +``` + +Use `zcat` if the file has been rotated and compressed: + +```shell +zcat @400000006026b71d1a7af804.s | (head -1; tail -1) | jq '.time' + +zcat some_json.log.25.gz | (head -1; tail -1) | jq '.time' +``` + ### Parsing `production_json.log` and `api_json.log` #### Find all requests with a 5XX status code |