InfluxDB2 Wrapper

This project contains operators to read from and write to an influx database version 2.

Important! The timestamp used to write to the database is from the meta data. So if you have an attribute that contains the time, you will need to adjust the time stamp inside the meta data, e.g. with

TIMESTAMP({START = 'time'},MAP({expressions = [['toLong(CurDate())', 'time']], KEEPINPUT = true}, nexmark:bid))

Writing to a influx db can be done with the INFLUXDB2WRITER:

#PARSER PQL
#RUNQUERY
timer = TIMER({PERIOD = 1000, SOURCE = 'timer1'})

map = MAP({EXPRESSIONS = [['counter()','TimerCount']]}, timer)

out = INFLUXDB2WRITER({FIELDS = ['TimerCount'], 
						URL = 'http://localhost:8086', 
						token='...',
						organisation='...', bucket='...', measurement='timer1'}, map)

Another example for writing with nexmark:

#PARSER PQL
#RUNQUERY
bid = TIMESTAMP({START = 'time'},MAP({expressions = [['toLong(CurDate())', 'time']], KEEPINPUT = true}, nexmark:bid))

out = INFLUXDB2WRITER({FIELDS = ['price'], TAGS = ['auction','bidder','datetime'],
						URL = 'http://<host>:8086', 
						token='<TOKEN FROM INFLUX>',
						organisation='Odysseus', bucket='Odysseus', measurement='auction'}, bid)

  • No labels