influxdata / influxdata/kapacitor
Kapacitor alert template adding escape character for double quotes
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
I am using Kapacitor to send alerts via post method to elasticsearch. However, I was unable to do, so to debug further I was using a local django application to read the post response. By using alert template I am able to get the data in desired format:
`{"\"id\": \"4g-alert\",\"time\": \"2022-10-19 13:30:01 +0000 UTC\",\"tag1\": \"0005B951C718_10213\",\"KPI_Name\": \"KPI_name,\"KPI_value\": \"0\",\"Level\": CRITICAL,\"previousLevel\": CRITICAL\""}`
However the kapacitor alert is adding '\' as escape character, when I tried to send the same json using curl command it worked. Any way to remove the slash(\) or any other solution for this.
Contributor guide
Research direction
The issue names no repository files, tests, or entry points. Start by comparing the Kapacitor alert-template POST body with the working curl request and inspect how the local Django endpoint receives it. Done means identifying whether the escaping occurs during template rendering or request encoding and confirming that Elasticsearch receives valid JSON.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, elasticsearch, go
- Domain
- api, backend, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100