Telegraf/Influx + Grafana join data from two tables

Hello,

I use InfluxDB v2.7.5 and telegraf to collect data from different sources like snmp and telemetry.
I query different things via grafana with influxQL and I want to merge/replace data from two tables.
My problem is that I have an index in on table but the corresponding name to the index is stored in another table and I want to display the name instead of the index in grafna

for example:

  1. measurement is received through SNMP/telemetry and has data of
    A | B | …|
  2. measurement is received from telemetry and has data of
    A | data | …|

and I want to display
| B | data in grafana

Any ideas how to solve this problem without using flux?

thanks

@Doruntola The short answer is that there isn’t a way to do this with InfluxQL. This type of operation would require a join, which InfluxQL doesn’t support. This is definitely possible using Flux, but it doesn’t sound like you want to go that route.

hi scott,

thanks for the fast reply. Could I go another route and enrich my telemetry data at the telegraf input stage already with an processor?

[[inputs.cisco_telemetry_mdt]]
→ Do some processor magic here and get the tag from the other table

Would that be possible?

thanks

Yes, might be able to do that. If the B names are static, you can just use Telegraf’s enum processor. It gets tricky if the list of names changes and you have to query them from somewhere. I’m not sure how exactly you’d do that.

If Grafana is the only place where you are planning to use query results, one of possible ways to do that is to use Grafana’s Join by field transformation: