No output when querying data from database using influxql

I am using ec2 instance on which i am running influxdb as docker container. Version of influxdb is 2.0, i want to query data using influxql. I have created the mapping of bucket required. Retention policy i mentioned was infinite.

Following is query i am using:

curl --request GET http://localhost:8086/query?db=db_name --header "Authorization: Token Token_id" --data-urlencode "q=SELECT * FROM db_name.measurement_name WHERE tag1=value1 AND tag2=value2 AND time >= '2022-06-06T07:00:00Z' AND time <= '2022-06-06T07:30:00Z'"

The output returned everytime is {}

I am sure that data is there for particular tag values and in that time duration by verifying in influxdb ui. Not sure what is the issue here. Can anyone help

Hello @Pratik_Das_Baghel,
Can you verify that you have:

  1. data then?
    Try querying with Flux
    The equivalent Flux query would be:
from(bucket: "db_name")
  |> range(start: 2022-06-06T07:00:00Z, stop: 2022-06-06T07:30:00Z)
  |> filter(fn: (r) => r["_measurement"] == "measurement_name")
  |> filter(fn: (r) => r["tag1"] == "value1")
  |> filter(fn: (r) => r["tag2"] == "value2")
  |> yield(name: "my data")

As an aside, why do you need to query with InfluxQL? It might be easier to just query with Flux.
The following posts might be helpful to you:

  1. A DBRP mapping
influx v1 dbrp list

Thanks!