3

Is there a way to update existing measurement names in an InfluxDB? When my system was originally set up we used measurement names like "CheckCPU" or "CheckLOAD" and have changed to all lower case such as "checkcpu" and "checkload" which is throwing off the historical data displayed in Grafana. Is there a way to modify the old names to all lower? Something like: UPDATE TO ?

I'm not really a DB guy at all, seems easy enough, but thought I'd see if anyone has had to do this or has an idea. The biggest factor is the need to keep the existing data, we've got over 2 years of history. In reading the documentation I see how to write data, but not update or change existing tags (specifically measurement names). TIA, Jason

Jason P
  • 33
  • 1
  • 6

1 Answers1

3

AFAIK, influxdb still doesn't have builtin rename/alter support for database and measurements. So, the easiest and safest way is to copy existing data into new measurement name.

Have a look at influxdb documentation on INTO clause and examples there:

SELECT_clause INTO <measurement_name> FROM_clause [WHERE_clause] [GROUP_BY_clause]

After old data is copied into new measurements you can drop old ones.

Yuri Lachin
  • 176
  • 4