UPDATE records Capacitor or Telegraf

Hi all

The following is a draft specification for a function that avoids duplication of records with a CREATE and instead performs an UPDATE. It is not clear to me what is the most efficient tool to implement this functionality for influxdb 1.8, Capacitor or Telegraf and would therefore welcome any suggestions.

Specification and Requirements for UPDATE (with DELETE/CREATE)

  1. Condition is that the timestamp and all of the following tags are identical:
  • tag1
  • tag2
  • tag3
  1. Copy all fields and tags from the old record to the new record.
  2. Write all fields and tags that are provided in the new input into the new record. Either add these as new fields/tags if they do not exist in the old record or overwrite any existing field/tags if they already exist in the old record.

Many thanks for any help
E

Hello @allomorphy,

There is delete and drop functionality in 1.x.
You can upsert any fields if you write the same series with the same timestamp. For example if you wrote:

measurement,tagkey1=tagvalue1 fieldkey=value1 timeinunix1

And then wrote:

measurement,tagkey1=tagvalue1 fieldkey=value2 timeinunix1

You would upsert the field value.
However if you tried to write:

measurement,tagkey1=tagvalue2 fieldkey=value1 timeinunix1

You’d be creating a new series because tags are indexed and so the value wouldn’t be upserted. In this instance you would have to drop points with yout old tag and write your new data.