从infuxdb 2中的(全桶)的通量

发布于 2025-01-31 21:25:43 字数 629 浏览 4 评论 0原文

我有一个动态数量的水桶,我只想列出包含字段特定值的存储桶。

因此,这里有一个更具体的解释:

我有X量的存储桶,每个存储桶都有一个名为软件的字段,我只想列出包含软件中某个值的存储桶。

示例:

if bucket == (
    <bucket>
        <Measurement>
            <Field> == "Software"
                <_value> == "test" ) {
    list.append(bucket)
else {
    continue
}

我只需要存储桶的名称即可在列表中显示它们以显示来自该系统的数据的图表。

它在我现在使用的仪表板变量中使用:

buckets()

所选系统在仪表板面板中的查询中。

想到每个仪表板都是一个软件,因此我们拥有所有系统/存储库,其中该软件可在列表中选择。

系统可以更改软件,其他一些因素使我希望将系统作为存储桶而不是软件。

我已经尝试了我在Google和YouTube上可以找到的所有内容,但没有一个答案,以查询如何查询动态数量的存储桶/所有存储桶

I have a dynamic amount of buckets that i want to list, i only want to list the buckets that contain a specific value from a field.

So a more specific explanation here:

I have x amount of bucket, each bucket have a field called software, i want to list only the buckets containing a certain value in software.

Example:

if bucket == (
    <bucket>
        <Measurement>
            <Field> == "Software"
                <_value> == "test" ) {
    list.append(bucket)
else {
    continue
}

I only need the names of the buckets to show them in a list to show the graphs with data from that system.

It's used in a dashboard variable where i now use:

buckets()

And the chosen system is in the queries in the dashboards panels.

The thought is that each dashboard is one software so we have all the systems/buckets with that software to choose from in the list.

A system can change software and some other factors make me want to have the system as the bucket instead of the software.

I have tried everything i can find on google and youtube but none give the answer to how to query a dynamic amount of buckets/all buckets

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

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

发布评论

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

评论(1

壹場煙雨 2025-02-07 21:25:43

我找到了一种方法,如果我使用RegexP软件包中的查询中使用正则罚款

import "regexp"

// ending with abc
re = regexp.compile(v: ".*abc")

data = from(bucket: "example-bucket")
    |> range(start: -1h)
    |> filter(fn: (r) => regexp.matchRegexpString(r: re, v: r._measurement))

,或者只是在仪表板变量的Grafana中设置Regex

I found a way if i use the regex either in the query with the regexp package

import "regexp"

// ending with abc
re = regexp.compile(v: ".*abc")

data = from(bucket: "example-bucket")
    |> range(start: -1h)
    |> filter(fn: (r) => regexp.matchRegexpString(r: re, v: r._measurement))

Or just setting a regex in Grafana on the dashboards variable regex box

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