Hello folks.
is it possible to have kapacitor working on a specific column and outputs only the column it worked on as result?
Basically I have a feed contains few columns
tag1, tag2, col1, col2, col3
I only need few metrics of, say, col2. So i came up with something like
`var my_stream = stream
|from()
.database(‘db’)
.retentionPolicy(‘r1’)
.measurement(‘m1’)
.groupBy(‘name’)
|window()
.period(30s)
.every(30s)
.align()
var first_value = my_stream|first(‘col2’).as(‘value’)
var last_value = my_stream|last(‘col2’).as(‘value’)
first_value
|join(last_value)
.as(‘first’, ‘last’)
|httpOut(‘my_stream’)
`
However, this does not work because the result will simply contains all columns of the original stream. Plus, it will rename all columns like first.xxx, second.xxxx.