Hello,
x-influxdb-build: OSS
x-influxdb-version: v2.7.4
I am adding a bunch of geo data to my influxdb, things like IP, Lat/Long, City, etc.
I can query unique entries like so:
from(bucket: "xx")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "traffic_report")
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
however what I need in addition is a “count” which counts each unique entry by ip.
So if for example my data was:
ip,lat,lon
127.0.0.1,50,100
127.0.0.1,50,100
172.1.1.2,30,50
How could I then return something like this?
ip,lat,lon,count
127.0.0.1,50,100,2
172.1.1.2,30,50,1
Tried a bunch of stuff and really struggling to get this, maybe I’m not inserting the data correctly.
Regards