TimelessLogs.LogsQL (timeless_logs v1.4.12)

Copy Markdown View Source

Parser for the subset of LogsQL that DDNet sends.

Parses queries like:

_time:1h level:error service:dhcp "search term" | sort by (_time) desc | limit 50 offset 0
_time:[2024-01-01T00:00:00Z, 2024-01-02T00:00:00Z) level:warning
_time:24h | stats count() as total
*

Returns {:query, filters} or {:stats_count, filters} where filters is a keyword list compatible with TimelessLogs.query/1.

Summary

Functions

parse(query)

@spec parse(String.t()) :: {:query, keyword()} | {:stats_count, keyword()}