Skip to main content

Real-Time Commands

Commands for live monitoring and time-based comparison: tail, top, watch, and diff.

tail

Live tail logs from server via Server-Sent Events (SSE).

lynxdb tail [filter] [flags]

Alias: t

Flags

FlagShortDefaultDescription
--count-n100Number of historical events to fetch before live streaming
--from-1hHistorical lookback period

Examples

# Stream all events
lynxdb tail

# Stream errors only
lynxdb tail 'level=error'

# Stream 5xx from nginx
lynxdb tail 'source=nginx status>=500'

# Last 50 events + live
lynxdb tail --count 50 --from -1h

Console Output

Events are colorized by level with timestamp, source, and message:

2026-01-15T14:23:01Z [ERROR] nginx: connection refused to upstream
2026-01-15T14:23:02Z [INFO] api-gateway: request handled in 45ms
--- historical catchup complete (47 events, 312ms) — streaming live ---
2026-01-15T14:23:03Z [ERROR] nginx: timeout exceeded

Press Ctrl+C to stop.


top

Full-screen live TUI dashboard of server metrics.

lynxdb top [flags]

Flags

FlagDefaultDescription
--interval2sRefresh interval (e.g., 2s, 5s)

Shows four panels:

PanelMetrics
IngestRate, today count, total count
QueriesActive, cache hit rate, views, tail sessions
StorageSize, segments, memtable, indexes
SourcesBar chart of events by source

Press q or Ctrl+C to quit.

Examples

lynxdb top
lynxdb top --interval 5s

watch

Re-run a query at regular intervals with a live-updating TUI display.

lynxdb watch [SPL2 query] [flags]

Flags

FlagShortDefaultDescription
--interval5sRefresh interval (e.g., 5s, 30s, 1m)
--since-s-15mTime range for each execution
--difffalseShow delta from previous run

Press q or Ctrl+C to quit.

Examples

# Watch error counts by source, refresh every 5s
lynxdb watch 'level=error | stats count by source'

# Custom interval
lynxdb watch 'level=error | stats count' --interval 10s

# Show changes between refreshes
lynxdb watch '| stats count by level' --since 1h --diff

diff

Compare query results across two consecutive time periods. Useful for spotting trends and anomalies.

lynxdb diff [SPL2 query] [flags]

Flags

FlagDefaultDescription
--period1hCompare last N vs previous N (e.g., 1h, 6h, 24h)

Examples

# Compare error counts: last hour vs previous hour
lynxdb diff 'level=error | stats count by source'

# Explicit period
lynxdb diff 'level=error | stats count by source' --period 1h

# Compare 5xx over 24h
lynxdb diff 'status>=500 | stats count by uri' --period 24h

Console Output

  Comparing: last 1h vs previous 1h

source NOW PREV CHANGE
nginx 340 280 +21.4%
api-gateway 120 150 -20.0%

Total: 460 vs 430 (+7.0%)

See Also