I need to delete all measurements from a database called metrics within a given timerange.
It would be okay delete from the different measurements one at a time. For example, if there are measurements volume and level in the metrics database, send something like this(this doesn’t work though):
delete from metrics.volume where time > startTime and time < endTime;
delete from metrics.level where time > startTime and time < endTime;
Although it would be much better if I could just delete all measurements from the metrics db within the timerange. Like if I could send this (but this also doesn’t do anything):
delete from metrics where time > startTime and time < endTime;
So here are the problems:
-
When I try to do
delete from volume where time > startTime and time < endTime;
, when the database is set to metrics, that WORKS inside the InfluxDB shell. But when I send that command from my server, that doesn’t do anything.
Presumably because I need to set the database to metrics. But I don’t know how to do that. The log looks like this:lvl=info msg="Executing query" log_id=0p_2v~sG000 service=query query="DELETE FROM volume WHERE time = 0"
and gives a 200 response, but nothing is deleted. -
I can’t figure out a way, even just inside the InfluxDB shell, to just delete all measurements from the entire metrics db within a timerange
Ploppity is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.