Company
Date Published
Author
Cyril Tovena
Word count
1193
Language
English
Hacker News points
None

Summary

LogQL, the query language for Grafana Loki, offers several advanced features that enhance log querying and analysis capabilities. Inspired by PromQL, LogQL has evolved since 2020 to include extensions for extracting, transforming, and filtering logs. Notable features include the ability to count sample values per second using the unwrapped rate, calculate the length of extracted values with the text template engine, and utilize a new variable called __line__ for outputting actual log lines. LogQL allows for multiple parsers within a single query, grouping with range vector aggregations, and filtering using bytes and duration label filters. Users can also reformat log lines for improved readability, apply IP filtering, and even add emojis to logs using UTF-8 characters. Additionally, LogQL enables access to array values in JSON and supports commenting within queries, making it a versatile tool for managing logs in Grafana Loki.