l24 query

l24 query runs a search against the logging24 API. This page documents the current CLI surface from l24 query --help .

Usage

l24 query [options]  

Both positional arguments are required, and --customer is required as well.

Quick examples

l24 query --customer "TechCorpInc" ".*ERROR.*" env://L24_READ_TOKEN
l24 query --customer "StoreInc" --type lch -f "now - 7days" -N 7 ".*Sale completed.*" file://read.token
l24 query --customer "$L24_CUSTOMER" --prefix0 "web-" --prefix1 "nginx" ".*timeout.*" env://L24_READ_TOKEN

Log context options

-c , --customer Your logging24 customer account. Required.
--prefix0 Query prefix0
--prefix1 Query prefix1
--prefix2 Query prefix2
--prefix3 Query prefix3

Query options

-f , --from Start of query time range. Default: now-1h .
-t , --to End of query time range. Default: now .
-T , --type Query type. Default: logs-backwards .
-l , --limit Maximum number of log results. Default: 100 .
-N , --time-bins Number of time buckets. Default: 10 .

Output options

--time-format nanoseconds , iso , or short . Default: short .
--try-decode Try to decode log messages to JSON when printing results.
--format plain , json , csv , or tsv . Default: plain .
-x , --splits Output bucket split boundaries for counting queries.

Repeated query options

-r , --repeat Number of times to repeat. 0 means infinite. Default: 1 .
-i , --interval Interval between repeats.
--progress Output query progress.

Connection option

-a , --api Base URL of the logging24 API. Default: https://api.logging24.com .

Query types

logs-backwards / lb Search in reverse chronological order. Default.
logs-unsorted / lu Search for any logs matching the query.
log-count-hist / lch Return counts over time.
last-per-key / lpk Return the most recent log line for each captured (?) key.

Related links