Skip to content

Instantly share code, notes, and snippets.

@dictvm
Created November 15, 2017 09:09
Show Gist options
  • Save dictvm/419ad2f443826784cfbcc2ff5766104e to your computer and use it in GitHub Desktop.
Save dictvm/419ad2f443826784cfbcc2ff5766104e to your computer and use it in GitHub Desktop.
Count Series in InfluxDB
influx -database '$DATABASE' -format 'csv' -execute 'SHOW SERIES' | grep -v "name,_id,host" | wc -l
@alexgdmx
Copy link

alexgdmx commented Aug 13, 2018

> select * from _internal.."database" where "database"=~/YOUR DATABASE NAME/ order by time desc limit 1
name: database
time                 database hostname     numMeasurements numSeries
----                 -------- --------     --------------- ---------
2018-08-13T16:11:50Z prime    4eba75b72aae 5               7336
>

don't forget quote "database" since is reserved word and is used as measurement name and tag(column) name

@saranglakare
Copy link

Thanks for this! It was really useful.

I think better way to give the database name (that worked for me) was:

select * from _internal.."database" where "database"='DATABASE_NAME' order by time desc limit 1

@jwongz
Copy link

jwongz commented Apr 18, 2020

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment