Deleting measurements with corrupted/"non printable characters" names

Hello,

I have an issue similar to:
similar issue to : Corrupted Measurement

I have a bunch of old measurements with bad / corrupted names, and i cannot figure out how to delete them. various attempts via cli and curl have failed

example of bad/ corrupted names

�F@��@01
�F@��@vlentapptest01
�F@��@vlgraylogweb01
�F@��@vlrenderdbpp01
�u@mory
��@x@vlrenderdbpp01
��@twork
��@twork
��@ppet_agent

I tried the msgpack query, but i cannot figure out how to actually issue the drop measurement command. Cut and paste from the msgpack output doesnt work.

Is there any way to actually drop these measurments?

I think you’ll need to run CURL once you have the real measurement names.

something like

curl -u username -p password -XPOST 'http://influxDB_host:8086/query?db=your_db' --data-urlencode 'q= drop measurement "your_measurement"'

replace “your_measurement” with the measurement name you get from msgpack.

I’m not 100% on the influx API i tend to do most things in the CLI, but here’s some API docs that might help you structure the request how you want it.

The other option, as mentioned in the link you posted. Let the measurements age out through the retention policy. You’d need to create some new measurements for fresh data, then the old measurements will be dropped when the RP kicks in.

PS: careful copy and pasting, sometimes the forum changes the formatting of single and double quotes which causes problems.

ran the following to get the msgpack output

curl 'localhost:8086/query?db=icinga2' --data-urlencode 'q=show measurements limit 1' -H 'Accept: application/x-msgpack' >tmp

cut and paste from the msgpack output into the next command (not positive i cut and pasted correctly)

curl -XPOST 'localhost:8086/query?db=icinga2' --data-urlencode 'q= drop measurment "^A@V^?^@^@twork"'

output

{"results":[{"statement_id":0}]}

and measurement is still present when using

use icinga2
show measurements

Am i cutting and pasting wrong? is the data getting encoded incorrectly?

Is that the output you get? I was expecting it to give the actual measurement name. But, assuming that should be network you could just update the second query to drop “network” instead of “^A@V^?^@^@twork”

Whats the actual output from the x-msgpack query?

Here is the message pack output in both text and image form (in case something gets mangled.)

<81>§results<91><82>¬statement_id^@¦series<91><83>¤name¬measurements§columns<91>¤name¦values<91><91>­^P<88>^A@V^?^@^@twork

and the output from influx cli of show measurements

InfluxDB shell version: 1.8.9
> use icinga2
Using database icinga2
> show measurements
name: measurements
name
----
�@twork
�@name=mm02mercurypp24
�@mory
�@ppet_agent
@@me=mm02compute04
0}@mory
0�@ppet_agent
0�@��@servicedbpp01
@s@ocs

image

anyone have any other ideas on how to remove these “corrupted” measurements?