# SELECT query returns empty series

**URL:** <https://community.influxdata.com/t/select-query-returns-empty-series/32400>\
**Category:** Telegraf\
**Created:** [December 4, 2023, 7:22pm UTC](https://community.influxdata.com/t/select-query-returns-empty-series/32400 "2023-12-04T19:22:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rogelio\_Alvez](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rogelio_alvez/32/14242_2.png) [@Rogelio\_Alvez](https://community.influxdata.com/u/Rogelio_Alvez)\
**Post date:** [December 4, 2023, 7:22pm UTC](https://community.influxdata.com/t/select-query-returns-empty-series/32400/1 "2023-12-04T19:22:20Z")

</div>

Hello team:  
The following query returns me the contents of two series in my database: The tag of each series is the interface name (ifName) of a Cisco Switch:

> SELECT max(“ifHCInOctets”) FROM “interface” WHERE “hostname” = ‘SW-AR-CD-CBA-011’ AND time\>=now()-1h GROUP BY ifName, time(5m) fill(null)  
> name: interface  
> **tags: ifName=Gi1/0/25**  
> time max

* * *

2023-12-04T18:50:00Z 48354178426  
2023-12-04T18:55:00Z 48355855467  
2023-12-04T19:00:00Z 48357406516  
2023-12-04T19:05:00Z 48359095814

name: interface  
**tags: ifName=Gi1/0/26**  
time max

* * *

2023-12-04T18:50:00Z 2217425915  
2023-12-04T18:55:00Z 2217602923  
2023-12-04T19:00:00Z 2217743693  
2023-12-04T19:05:00Z 2217903465

> 

Now I want to go a bit deeper and query the series whereby ifName is equal to “Gi1/0/25”. Now influxDB returns me nothing. I tried many combinations without success:

> SELECT max(“ifHCInOctets”) FROM “interface” WHERE “hostname” = ‘SW-AR-CD-CBA-011’ AND **ifName=‘Gi1/0/25’** AND time\>=now()-1h GROUP BY time(5m) fill(null)  
> SELECT max(“ifHCInOctets”) FROM “interface” WHERE “hostname” = ‘SW-AR-CD-CBA-011’ AND **“ifName”=‘Gi1/0/25’** AND time\>=now()-1h GROUP BY time(5m) fill(null)  
> SELECT max(“ifHCInOctets”) FROM “interface” WHERE “hostname” = ‘SW-AR-CD-CBA-011’ AND **“ifName”=“Gi1/0/25”** AND time\>=now()-1h GROUP BY time(5m) fill(null)  
> SELECT max(“ifHCInOctets”) FROM “interface” WHERE “hostname” = ‘SW-AR-CD-CBA-011’ AND **“ifName”=Gi1/0/25** AND time\>=now()-1h GROUP BY time(5m) fill(null)  
> SELECT max(“ifHCInOctets”) FROM “interface” WHERE “hostname” = ‘SW-AR-CD-CBA-011’ AND **ifName=Gi1/0/25** AND time\>=now()-1h GROUP BY time(5m) fill(null)  
> SELECT max(“ifHCInOctets”) FROM “interface” WHERE “hostname” = ‘SW-AR-CD-CBA-011’ AND **‘ifName’=‘Gi1/0/25’** AND time\>=now()-1h GROUP BY time(5m) fill(null)

¿ Am I missing something here?

> **show series from “interface” where “hostname”=‘SW-AR-CD-CBA-011’**  
> key

* * *

interface,agent\_host=10.133.38.12,hostname=SW-AR-CD-CBA-011,ifAlias=[TRUNK],ifName=Gi1/0/25,index=10125,sitecode=AR-CD-CBA,template=Switch-L2  
interface,agent\_host=10.133.38.12,hostname=SW-AR-CD-CBA-011,ifAlias=[TRUNK],ifName=Gi1/0/26,index=10126,sitecode=AR-CD-CBA,template=Switch-L2

Any help will be greatly appreciated.  
Best regards, Rogelio

**root@96b453224bc7:/# influx --version**  
**InfluxDB shell version: 1.7.9**

---

<div class="post-metadata">

**Author:** ![Rogelio\_Alvez](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rogelio_alvez/32/14242_2.png) [@Rogelio\_Alvez](https://community.influxdata.com/u/Rogelio_Alvez)\
**Post date:** [December 5, 2023, 12:06pm UTC](https://community.influxdata.com/t/select-query-returns-empty-series/32400/2 "2023-12-05T12:06:17Z")

</div>

I made it work! I followed the solution in this link:

> [@Unable to view individual switch interfaces. Is this a tag misconfiguration?](https://community.influxdata.com/t/unable-to-view-individual-switch-interfaces-is-this-a-tag-misconfiguration/32177/2):
>
> Hello @DeMoB , Are you able to return data if you do: SELECT derivative(mean("ifHCInOctets"), 1s) /1000000\*8 AS "In", derivative(mean("ifHCOutOctets"), 1s) /1000000 \*-8 AS "Out" FROM "snmp" WHERE ("hostname" = 'Server-Room-C-POE') AND $timeFilter GROUP BY time($interval) With no fill? I can’t see why adding a fill null would not allow you to view the results especially if you can select for all those values. Does this work? SELECT "ifHCInOctets"FROM "snmp" WHERE ("hostname" = 'Server-Room-…

Basically, I had to add the ::tag qualifier to ifName and use single quotes in the interface ID:

> SELECT max(“ifHCInOctets”) FROM “interface” WHERE (“hostname”=‘SW-AR-CD-CBA-011’) AND ( **ifName::tag=‘Gi1/0/25’** ) AND time\>=now()-10m GROUP BY time(5m)  
> name: interface  
> time max

* * *

2023-12-05T11:45:00Z  
2023-12-05T11:50:00Z 48693265498  
2023-12-05T11:55:00Z 48694643333

>
