influxdata / influxdata/kapacitor
TICKScript woes - Adding two fields
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
I'm not really sure where to start with this one, but I have tried on both the [community site](https://community.influxdata.com/t/sanity-check-simple-tickscript/3042/2) and the Gophers Slack channel.
I'm having some serious issues with a TICKScript that I'm sure worked for a period and now will not - And it's the simplest script ever.
```
// Measurement selection
var db = 'telegraf'
var rp = 'autogen'
var measurement = 'winperf_hypervhealth'
var groupBy = ['host']
var whereFilter = lambda: TRUE
// Get a window of data
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
// Keep only one field
|eval(lambda: "Health_OK" + "Health_Critical")
.as('Total_VMs')
.keep()
|influxDBOut()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.tag('kapacitor', 'true')
```
I literally only need to sum two fields, but as the info says in the community forum post, I either get data from a single node, or not at all. If I change the `influxDBOut()` to an `alert()` node with `.log()`, I see all 3 fields have values.
Nothing in the logs that I can see, and I have other TICKScripts running and writing to InfluxDB with no issues.
Any ideas?
Contributor guide
Research direction
Start with the TICKScript shown in the issue, especially the eval node and its influxDBOut output. Reproduce the behavior with the three fields and compare it with the alert/log output described. Done means the two fields are combined as intended and the resulting data is written successfully to InfluxDB.
Written by the indexing model from the issue text.
Assessment
- Domain
- stream-processing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100