Grafana Regex符合名称

发布于 2025-01-31 15:49:52 字数 462 浏览 1 评论 0原文

这些是在Grafana中监视电池电量的iPad和电话。 我该如何过滤,因此它将仅向我展示iPad(从设备名称“ H. ”开始) 当我尝试像“/^h.$/”这样的正则义务时,它不起作用。

谢谢

“错误”

These are iPads and phones with their battery levels monitored in Grafana.
How can I filter it, so it will show me the iPads only (starting with device name "H.")
When I try regex like "/^H.
$/" it doesn't work.

Thanks

grafana

error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微凉 2025-02-07 15:49:52

不是正则专家,但是^h。$从字面上看h。

您也需要匹配任何可能的以下字符。您可以使用\ w*的数字,小写和大写字符来做到这一点。

因此,就您而言,^h。\ w*$应该有效。

编辑

仔细查看您的图片后,我意识到要过滤的名称是列的行device_name,而不是列名称本身。但是,使用的按名称过滤过滤列名称,在您的情况下,在您的情况下device_namebattery_level。由于都不适合正则义务,因此返回“无数据”。

要过滤列的结果,您必须使用按值过滤数据。您必须指定字段,即列device_name,使用REGEX作为gode> Match> Match的类型,然后在value中输入REGEX字段。

如上所述,使用正则表达式。

Not a regex expert, but ^H.$ will only match H. literally.

You need to match any amount and type of possible following characters as well; you can do that for numbers, lowercase, and uppercase characters with \w*.

So in your case, ^H.\w*$ should work.

EDIT

After having a closer look at your pictures, I realize that the names you want to filter for are rows of the column device_name, not the column names themselves. However, the used Filter by name filters the column names, in your case device_name and battery_level. Since neither fit the regex, 'No data' is returned.

To filter the results of a column you have to use Filter data by values. You have to specify the field, i.e. the column device_name, use Regex as type for Match and then enter the regex in the Value field.

Use the regex as explained above.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文