Search code examples
influxdbinfluxql

Influxdb: How can I modify all values in a field? (divide current value by 100,000)


I have a lot of pressure data registered in Pa, but it should be in Bar (100,000 Pa).

How can I modify all values in a field in my Influxdb to be divided by 100,000?

What I would have done in MariaDB:

UPDATE table SET pressure = pressure / 100000

Solution

  • you cannot update a row but you can overwrite it (by the exact timestamp) just use the same insert wite same timestamp (un nano) e.g.

    insert tests,tag=tag pressure=200000 1505799797665800000
    insert tests,tag=tag pressure=2 1505799797665800000
    

    of coarse you should read the values before