Search code examples
opentsdb

How to group by and aggregate in openTSDB like RDBMS?


I have data in below format stored in openTSDB:

src_ip dst_ip protocol value timestamp 1.1.1.1 2.2.2.1 tcp 100 100000001 1.1.1.1 2.2.2.2 tcp 100 100000001 1.1.1.1 2.2.2.3 udp 100 100000002 1.1.1.4 2.2.2.4 icmp 100 100000003

They all belong to same metric say metric01.

I want to get the result like: select sum(value) from metric01 group by src_ip

Is there any way I can get the result from http api?


Solution

  • Now way for openTSDB to do it. Also if there is requirement like this, then openTSDB may be not your choice. openTSDB is time series db, also for kariosDB. I tried in openTSDB and kariosDB and found they both can not.

    Because in openTSDB , the group by is one thing, the aggregate is another thing. Not like RDBMS, the agg works on the group by. In openTSDB the agg works on the downsample