Flux query help for variable use

Hi
I am currently using this query to get a list of hostnames for a variable:
import “influxdata/influxdb/schema”
schema.tagValues(
bucket: “${BUCKET}”,
tag: “host”,
predicate: (r) => true,
start: v.timeRangeStart,
stop:v.timeRangeStop
)

but I get hostnames with 3 dots at the end and when that happens grafana is not displaying the data as I need it.

What would be a better query to get a list of complete hostnames from an influxdb in grafana for variable use?

I have now tried so many things I just cant get a flux query to list the contents of the host field.

Any help would be appreciated please.

Hi
The problem is not using th evariable in the dasjbpoard, but rather that the data is not retunred when I use the above query. If i use influx query and run the above query, it gives me a list of hosts that do not have the complete host in in the field. Rather the hostname is truncated and left with 3 dots. Here is an example:
I get this:
m-e-cmtuqausexaws208j8-731z3ylanp1r.dom…
m-e-cmtuusexaws208j8-2dc9wcktqsxm.dom…
m-e-cmtuusexaws208j8-3t6618ujp7y4.dom…
m-e-cmtuusexaws208j8-76nxfsr10fbz.dom…

but it should be this:
m-e-cmtuqausexaws208j8-731z3ylanp1r.domain.com
m-e-cmtuusexaws208j8-2dc9wcktqsxm.domain.com
m-e-cmtuusexaws208j8-3t6618ujp7y4.domain.com
m-e-cmtuusexaws208j8-76nxfsr10fbz.domain.com

So I either need a way to make the output column wider to inclde the full fqdn or I need an alternative query.

I have also additionally tried the v1 query you specified, but I still get the results as in my last reply.

This sounds more like a formatting issue in grafana than an influx issue. Is the actual data truncated or only the displayed string?
What is the result of the query in the Influx Web UI when displaying it in a table?

1 Like