influxdata / influxdata/kapacitor

"AND" operator with tick script templating and JSON

Open
#1,519 6 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,
I was trying to implement kapacitor alerting using templating. The challenge I am facing is using AND operator while passing var values in JSON file. For example, I cant find an option to add other value items in value field using AND.
"where_filter": {"type": "lambda", "value": "\"cpu\" == 'cpu-total'"},
I want to see something like this:
"where_filter": {"type": "lambda", "value": "\"cpu\" == 'cpu-total'" "and" "app": "\"app\" == 'demo'"},
Note - I tried, though the JSON validates fine but kapacitor doesn't like "and".

Appreciate any pointer on this.

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

No file or test is named; start by reproducing the issue's where_filter JSON in a minimal Kapacitor alerting configuration. Trace how the lambda value and templated JSON are parsed, then document or test the supported AND form, with completion defined as a configuration Kapacitor accepts.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
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.