tql-cli

Command line tool for querying logs made with timequerylog module.

Usage no npm install needed!

<script type="module">
  import tqlCli from 'https://cdn.skypack.dev/tql-cli';
</script>

README

Command line tool for querying logs made with timequerylog module.

npm i -g tql-cli

Usage

Show this readme in terminal.

tql --help

Show 'events' from last 30 minutes. Output is JSON.

tql event

Type 'errors' from start time with data directory 'datalog'.

tql -d datalog errors -s 05-01-2015

Type 'event' between start and end time.

tql event -s "2008-09-15T15:53:00+00:00" -e "2008-09-15T16:53:00+00:00"

Match function.

tql event -s 01-01-2010 -m "return r.x>r.y;"

Glob match type.

tql event -s 01-01-2010 -u "error*"

Sort results after glob match

tql event -s 01-01-2010 -u "error*" -r "return a.id < b.id ? 1 : -1"

Glob match has optional map function.

tql event -s 01-01-2010 -u "error*" -a "return r.message"

Show last recorded data.

tql event -l "trade"