Rum*_*mid 9 grafana grafana-loki
我正在关注文档,并且感谢| line_format并且regexReplaceAll我能够从一行中获取一些子字符串。
假设现在我有这些专栏:
line
123
7
123
54
14
Run Code Online (Sandbox Code Playgroud)
有了这个,我想执行一些变换操作、求和或通过分组和求总计进行变换操作。它不起作用,因为我怀疑这些值不是数字,而只是字符串。是否可以将其转换为数字?
我尝试使用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]
)
Run Code Online (Sandbox Code Playgroud)
最终结果是
管道错误:系列的“SampleExtractionErr”:
当我过滤错误时,没有结果。
| 归档时间: |
|
| 查看次数: |
4598 次 |
| 最近记录: |