# Flux query help for variable use

**URL:** <https://community.influxdata.com/t/flux-query-help-for-variable-use/26438>\
**Category:** InfluxDB 2\
**Tags:** flux\
**Created:** [September 7, 2022, 11:20am UTC](https://community.influxdata.com/t/flux-query-help-for-variable-use/26438 "2022-09-07T11:20:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yo\_kobus](https://avatars.discourse-cdn.com/v4/letter/y/f475e1/32.png) [@yo\_kobus](https://community.influxdata.com/u/yo_kobus)\
**Post date:** [September 7, 2022, 11:20am UTC](https://community.influxdata.com/t/flux-query-help-for-variable-use/26438/1 "2022-09-07T11:20:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yo\_kobus](https://avatars.discourse-cdn.com/v4/letter/y/f475e1/32.png) [@yo\_kobus](https://community.influxdata.com/u/yo_kobus)\
**Post date:** [September 7, 2022, 12:46pm UTC](https://community.influxdata.com/t/flux-query-help-for-variable-use/26438/3 "2022-09-07T12:46:34Z")

</div>

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](http://m-e-cmtuqausexaws208j8-731z3ylanp1r.domain.com)  
[m-e-cmtuusexaws208j8-2dc9wcktqsxm.domain.com](http://m-e-cmtuusexaws208j8-2dc9wcktqsxm.domain.com)  
[m-e-cmtuusexaws208j8-3t6618ujp7y4.domain.com](http://m-e-cmtuusexaws208j8-3t6618ujp7y4.domain.com)  
[m-e-cmtuusexaws208j8-76nxfsr10fbz.domain.com](http://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.

---

<div class="post-metadata">

**Author:** ![yo\_kobus](https://avatars.discourse-cdn.com/v4/letter/y/f475e1/32.png) [@yo\_kobus](https://community.influxdata.com/u/yo_kobus)\
**Post date:** [September 7, 2022, 12:48pm UTC](https://community.influxdata.com/t/flux-query-help-for-variable-use/26438/4 "2022-09-07T12:48:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brimstone](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@brimstone](https://community.influxdata.com/u/brimstone)\
**Post date:** [September 8, 2022, 8:33am UTC](https://community.influxdata.com/t/flux-query-help-for-variable-use/26438/5 "2022-09-08T08:33:53Z")

</div>

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?
