Hi, I’ve created a very simple TICKScript. Even though, it works as expected and writes data back to influxdb, it still returns these errors.
ts=2020-07-21T20:25:26.714+03:00 lvl=error msg="failed to realize reduce context from fields" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="field \"http_response_code\" missing from point"
ts=2020-07-21T20:26:22.787+03:00 lvl=error msg="failed to aggregate point in batch" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="field http_response_code missing from point cannot aggregate"
ts=2020-07-21T20:26:22.788+03:00 lvl=error msg="error while evaluating expression" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="left reference value \"status_code\" is missing value"
ts=2020-07-21T20:27:03.255+03:00 lvl=error msg="error while evaluating expression" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="left reference value \"status_code\" is missing value"
ts=2020-07-21T20:27:03.255+03:00 lvl=error msg="failed to realize reduce context from fields" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="field \"http_response_code\" missing from point"
ts=2020-07-21T20:27:46.283+03:00 lvl=error msg="error while evaluating expression" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="left reference value \"status_code\" is missing value"
ts=2020-07-21T20:27:46.284+03:00 lvl=error msg="failed to aggregate point in batch" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="field http_response_code missing from point cannot aggregate"
ts=2020-07-21T20:27:53.419+03:00 lvl=error msg="failed to realize reduce context from fields" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="field \"http_response_code\" missing from point"
ts=2020-07-21T20:27:53.420+03:00 lvl=error msg="error while evaluating expression" service=kapacitor task_master=main task=TRANSFORM_HTTP_2 node=influxdb_out11 err="left reference value \"status_code\" is missing value"
I collect data using telegraf’s http_response plugin.
var measurement = 'http_response'
...
var groupBy = ['name', 'server', 'site']
var whereFilterSuccess = lambda: ("status_code" == '200' AND "result" == 'success')
...
var outputDB = 'kapacitor_debugging'
var outputRP = 'autogen'
var outputMeasurement = 'X001'
...
var window_size = 1m
var id = '{{ .TaskName }}:{{ .Name }}:{{ .Group }}'
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|window()
.period(window_size)
.every(window_size)
.align()
var total = data
|count('http_response_code')
.as('counter')
var success = data
|where(whereFilterSuccess)
|count('http_response_code')
.as('counter')
var availability = total
|join(success)
.as('total', 'success')
.fill('null')
|eval(lambda: "total.counter", lambda: "success.counter", lambda: float("success.counter") / float("total.counter"))
.as('total', 'success', 'rate')
.keep('total', 'success', 'rate')
|log()
.prefix('A021')
|influxDBOut()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.precision('s')
.quiet()
It says that errors are coming from influxdb_out node even though I’ve used the option .quiet()
. I don’t need the http_response_code
or status_code
. I’ve what I need in |log()
and it writes to influxDB as expected. Yet there are errors. Any help?