LogQL (LogsQL) is a query language used within VictoriaMetrics to search, filter, and analyze log data. It is designed for efficient log retrieval, enabling users to extract specific log entries based on time, content, metadata, or numeric calculations. This tutorial provides a detailed overview of LogQL commands—primarily filters and mathematical operations—along with examples to help you construct effective queries. The content is structured for both beginners and advanced users, serving as a reference for future use.
A LogQL query consists of:
- Filters: Criteria to select logs, such as time ranges, words, or field values. At least one filter is required.
- Optional Actions: Operations like
stats
,fields
, oreval
applied to filtered logs, separated by the pipe (|
) operator.