Delete series with numeric names

Hi,

I’ve made a bit of a error while experimenting with InfluxDB and Telegraf’s csv file and have managed to create a bunch of measurements with numeric names. Which I’m unable to remove with the drop command

> drop measurement 99983224
ERR: error parsing query: found 99983224, expected identifier at line 1, char 18`

I’ve also tried

> drop measurement "99983224"
ERR: error parsing query: found 99983224, expected identifier at line 1, char 18`

How do I get rid of these measurements?

Version: InfluxDB 1.7.4

Kind regards

Richard Lucas

Hi ,
here it works , you could try delete from “99983224”
if drop measurement does not work

 > insert 99983224 field1=5
 > select * from "99983224"
 name: 99983224
 time                field1
  ----                ------
 1551721147552674690 5
 > drop measurement "99983224"  
 > select * from "99983224"

Hi Marc,

Thanks - that works a dream with the 2 steps - delete anything in them, and then drop the measurement.

I hadn’t realised that I needed to do both.

Thanks for taking the time to help.

Richard

One of them is enough :slight_smile: delete everything/anything removes the measurement , it is strange the drop didn’t work for you , i have 1.7.4 on linux

Do you have an idea what the problem could be here ? …

Csv problem telegraf

1 Like

I have no idea what has happened over night, except we restarted our servers, and now the drop measurement command works as you demo’d.

I piped the list of numerical names into a file and then passed that into this little bash script that executed a influx command to drop the metric.

#!/usr/bin/env bash
for met in $(cat "${1}"); do
    echo $met
    ./monitoring/influxdb/influx -port 8086 -database="telegraf" -execute "drop measurement \"${met}\""
done
1 Like