influxdata / influxdata/kapacitor

Unable to print the value for a condition

Open
#1,022 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.