Execute Influx on CLI

Hi community,
I’m a totally newbie on influxDB, I have an already DB installed on RHEL7 and I’m try to do some tests using the CLI.

The following command works perfect and show me the databases:
# influx -host x.x.x.x -execute 'SHOW DATABASES'

The question is simple, how can I combine 2 commands like:
# influx -host x.x.x.x -execute 'use stat, show series'

So just use a specif database and then show series on this DB.

Thank you

EDIT: To be more clear, what I have to do is something like:

# influx -host x.x.x.x -execute 'use stats; DELETE from status'
ERR: Database stats; DELETE from status doesn't exist. Run SHOW DATABASES for a list of existing databases.
DB does not exist!

Hello @LordSpectre,
You would do something like:

USE stat

But it looks like that db doesn’t exist for you yet, so youll need to create one first.

Thank you, the DB exists, it’s my fault, I reported the output command from other server :slight_smile:

I used something like:
influx -host x.x.x.x -execute 'DELETE from status' -database="stats"

But this is also working fine:
influx -host x.x.x.x -execute 'show series on stats'

But this is not working:
influx -host x.x.x.x -execute 'delete from status on stats'

Then I still don’t understand if it’s possible to concatenate two other commands in one CLI row like:

show series
DELETE from status
1 Like

@LordSpectre thanks for sharing your solution and thought process