在 LogQL 中获取原始条目值 line_format

Get original entry value in LogQL line_format

在 LogQL line_format 模板表达式中,有没有办法访问原始日志条目(假设该条目不在 JSON 或任何可解析格式中,并且所有标签都是日志标签且未提取标签)。

示例: ... | line_format "{{.log_label1}}, {{.log_label2}}: {{<some way to show the entire original log entry>}}"

一种方法是在其前面添加捕获整个消息的正则表达式

... |regexp '(?P<message>.*)' |line_format "{{.some_other_var}} {{.message}}"

Note that the ' around the regex should really by ` otherwise it might not work