Is it possible to make query with influxql on grafana 10, to target Influxdb version 2.7.4

Hello,

I want to use Influxql to query Influxdb v2.7.4.
How can i do this.
What should i set in Grafana and what should i change and set in Influxdb side.

Hello @ivbtar,

I’m not sure of what you are asking:
Are you trying to use influxdb v1 “language” to fetch data from an influxdb V2 base?

Regards

Yes exactly. Influxdb v1 influxql “language” to fetch data from an influxdb V2 base?
I can do this on the commandline cli influx v1 shell. But i need to add this db as datastore on grafana and write influxql.

Ok, first of all, why don’t you just create an influxdb V2 connection on your grafana?

Second, if you can use v1 to fetch data from v2, I assume you can do the same with the different Grafana panels using the raw query mode instead of the editor query mode.

Let me know if this works…

1 Like

Hello,

I enter the below command on linux to enter influx cli on influxdb v2.7.4

“[ivuser@centos-ops1 ~]$ influx v1 shell”

Then it puts me in influx shell so that i can use influxql, although i am on v2.7.4

grafanatable4

If i run below command :

select * from WMwareRawData10 limit 1
I get the output as a table.

Raw query mode only accepts FLUX language. But i want to use InfluxQL.
Like i use on influx v1 shell on influxdb v2.74 db.

How can i run InfluxQL command - Not Flux - in grafana to get data as a table from Influxdb 2.7.4

Hey,

I get it.
So you have an Influxdb V2 base, you have configured an influxdb V2 connection on your Grafana, but want to use the influxdb V1 “language” to fetch data.

Since you’ve set up a V2 connection, I assume that Grafana will always lead you to the flux language… Besides, the flux language is much more powerful and flexible than influxdb v1. Why don’t you wanna use the flux? Maybe we can find a workaround if you explain the problem that force you to use v1?

Regards

Hello @codi639,

Before v2.7.4, i was using influx 1.8. I had no problem to get all the data as table.
Bu with flux i face problem to get data as table.

The below problem caused me to search for solution on v1.
I had same data in 1.8 version and was displaying it on grafana table panel.
But now when i try same data and same table panel with v2 i icannot display all daha on grafana.

Hey,

I see the problem, honestly I think you should try to solve it using the flux language and playing with the transformations as @grant2 advised you.
Can you show me what happen in Grafana if you build an influxdb V1 query in the query field of the panel? I want to see if Grafana returns an error or some thing else…

Regards

Hello,

In v1 shell the command (select * from VMwareRawData5) is working on influxdb 2.7.4.

But on grafana it gives error :

invalid: error @1:1-1:7: undefined identifier select error @1:1-1:14: ( ?bucket: string, ?bucketID: string, ?host: string, ?org: string, ?orgID: string, ?token: string, ) => stream[{A with _value: B, _time: time, _measurement: string, _field: string}] (function) is not Divisible error @1:15-1:29: undefined identifier VMwareRawData5

I also added new screenshots to below post :

Yeah, I’m not so surprised…
Using an influxDB V2 connection, Grafana expect flux language. As you said, to use the influxDB V1 language you forced your influx V2 CLI to switch to a V1. Since you can’t do that directly on the panel (maybe you can?), Grafana is struggling with the syntax…
For now I don’t have any solutions, I keep in mind this topic if anything comes to me!

Regards