Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

tr2list

List the records of a timeranger2 topic, with rich filtering, field selection, metadata, and local-time output. The topic/database are deduced from the PATH.

Usage

tr2list PATH [options]
tr2list /yuneta/store/.../topic --from-rowid -10            # last 10 records
tr2list /yuneta/store/.../topic --key mykey --mode table
tr2list /yuneta/store/.../topic --follow                    # tail -f

Options

OptionPurpose
--key / --not-key / --rkeyMatch by key (exact / negated / regex)
--from-t / --to-tRecord-time range
--from-tm / --to-tmMessage-time range
--from-rowid / --to-rowidRowid range (negative = from the end)
--user-flag-set / --system-flag-set (+ …-not-set)Flag filters
--filterJSON dict of field matches; each key is a PATH (see below)
--fieldsSelect output fields
--mode form|tableOutput layout
--show_md2Include __md2__ metadata
--print-local-time / -tLocal timestamps
--recursive / -rWalk subtopics
--follow / -FLive tail (not with -r)
--dry-run / -nResolve and print the plan only
--list-databasesList databases under the path
--verbose / -lVerbosity level

Filtering by field

--filter takes a JSON dict. A record is listed when every key of the dict, read as a path into the record (segments joined by `), holds exactly the value given. A key without ` is a top-level field:

# records whose top-level field "state" is "on"
tr2list /yuneta/store/x/topic1 --filter='{"state": "on"}'

# records whose nested field device.model is "T-100", AND state is "on"
tr2list /yuneta/store/x/topic1 --filter='{"device`model": "T-100", "state": "on"}'

For the record {"state": "on", "device": {"model": "T-100", "fw": 3}} both filters match. The value is compared whole: {"device": {"model": "T-100"}} does NOT match it, because device also holds fw — name the leaf with a path instead.

See also