【发布时间】:2021-04-20 13:52:14
【问题描述】:
我正在关注documentation,感谢| line_format 和regexReplaceAll,我能够从一行中获取一些子字符串。
假设现在我有这些列:
line
123
7
123
54
14
如果我想执行一些变换操作、ex sum 或变换操作,则需要进行分组和总计。 它不起作用,因为我怀疑这些值不是数字,而只是字符串。 可以转成数字吗?
我尝试使用unwrap,但没有成功:
sum_over_time(
{service="some"}
|="text expression"
| json
| line_format `{{ regexReplaceAll "text expression to remove from (\\d+)" .label_id "${1}" | trim }}`
| unwrap label_id [1m]
)
结果是
管道错误:系列的“SampleExtractionErr”:
当我过滤掉错误时,没有结果。
【问题讨论】:
标签: grafana grafana-loki