influxdata / influxdata/kapacitor
Kapacitor, New tag and value from variable
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi
I'm strugging to create a new tag in the TICK script which take values from the variale
Here is the sample code, Will highly appreciate any help
// value in variable emptile
var elptime = stream
|from()
.database('telegraf10')
.retentionPolicy('autogen')
.measurement('issue')
|elapsed('value' , 1s)
.as('elapsed')
//Add in tag
stream
|from()
.database('telegraf10')
.retentionPolicy('autogen')
.measurement('issue')
.where(lambda:"value" == 0)
|last('value') .as('value')
|eval(lambda:elptime) .as('elapsed') .tags('elapsed')
|influxDBOut() .database('elap') .measurement('elapnew1')
----------------------------
In other words I'm trying to find the elapsed time when value/status change along with all the other keyvalues.
Rgds
Pankaj
Contributor guide
Research direction
No repository file, test, or entry point is named; start by reproducing the supplied TICK script and checking how eval and tags handle variable-derived values. Done would be a confirmed supported behavior or a clearly scoped change that preserves the elapsed value and other fields in the InfluxDB output.
Written by the indexing model from the issue text.
Assessment
- Domain
- stream-processing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100