Can field keys be deleted from a measurement?


A programming error in a script resulted in us preparing and uploading a Line Protocol file which included some invalid field key/value pairs; the file specified some fields with value 0 but the fields should not have been included at all.
The result is that a SHOW FIELD KEYS on the database shows many more fields than are appropriate for the measurement, and SELECT on a measurement series produces many more columns of output than we want. (Of course, we can specify the columns to display but * is much quicker to type!)

Is there some way to delete the incorrect fields from the measurement? (The fields in question need to be removed from all series in the measurement.)

Jeremy Begg


@JeremySTX Sadly there isn’t a way to do this cleanly in Influx currently. This issue is tracking progress as has some suggestions as to how to accomplish this (Hint: SELECT ... INTO ...).

Thanks Jack, that confirms what I thought.

I have added a comment to the DROP FIELD feature request with an explanation of why the SELECT .. INTO mechanism isn’t really an acceptable workaround.

As it happens I am expecting in a few months we’re going to have rewrite the database anyway to add some more tags to every measurement, so that would be the time to remove the unwanted fields. But maybe by then you will have supplied the other features I want such as the ability to rename a database or to drop fields. :slight_smile:

1 Like