influxdata / influxdata/kapacitor
Unable to print the value for a condition
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi All,
Wrote the below tick scripts to print the field "Duration" in the slack channel for the condition of "target". However, the below seems to be not giving any alerts in the slack channel
```
var period = 2s
var every = 2s
var data = stream
|from()
.database('asgbackup')
.retentionPolicy('autogen')
.measurement('drive_info')
.where(lambda: "target" =~ 'Mysqltest6')
.groupBy(*)
|window()
.period(period)
.every(every)
|alert()
.message('Duration: {{ index .Fields "duration" }}')
.crit(lambda: TRUE)
.slack()
.log('/var/tmp/kapacitor/files.log')
```
Could you please help in what might be wrong..
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The provided TICK script is the only entry point mentioned; start by reproducing it with the stated database, measurement, condition, and Slack output. Inspect the alert log and message rendering to determine why no alert is emitted, and consider the issue done when the condition produces a Slack alert containing the Duration value.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100