influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.87k stars 3.55k forks source link

duplicate count #25214

Open tengdagg opened 2 months ago

tengdagg commented 2 months ago
I want to count the number of requests for duplicate ip client_ip
10.10.11.11
10.10.11.11
10.10.11.11
10.10.13.12
10.10.13.12
10.10.13.12
10.20.13.15
10.20.13.16
10.20.13.18
10.20.13.18
Assuming the original table looks like this, I would like to count it as client_ip _value
10.10.11.11 3
10.10.11.12 3
10.20.13.15 1
10.20.13.16 1
10.20.13.18 2

With this output, how do you write the statement,Tried many times without success Please help me.

sanderson commented 2 months ago

@tengdagg Where this isn't an issue with the database itself, but more of a query question, this would typically be better asked and answered in the InfluxDB community.

What version of InfluxDB are you using? What query language are you using?

tengdagg commented 2 months ago

@sanderson Thank you for your answer, I had already asked a question in the community but no one answered me I came here to ask the question I'm using influxdb version 2.7 and need to use the flux statement to query the