Open Sk1v opened 1 year ago
Try this, it should work:
modules:
default:
headers:
MyHeader: MyHeaderValue
metrics:
- name: jsonhc
type: object
help: healthcheks description
path: '{.description}'
labels:
env: prod
description: '{@}'
values:
status: 1
So the problem was with Healthcheck itself. This is what it was supposed to be.
{
"healthcheck": [
{
"status": "OK",
"description": "All good",
"sql": null
}
]
}
After that the module worked as I wanted it to. Also, to do what I had in mind, I needed a module like this.
path: '{.healthcheck[?(@.status != "OK")]}'
And then in case there was not "OK", I set up an alert so that I would be sent an email when the status == 1
same problem with non-slice JSON ((((
{"sip_status":"OFFLINE"}
not work path: '{.sip_status == "OFFLINE"}' values: status: 0
Hi all!
How to fix the error "Failed to execute jsonpath"
The goal is this: go to the url with a whip and take information from it, then transfer this information to the alert. So that when a letter arrived that something was broken, it was immediately written what exactly (and what exactly broke was written in the check). Check looks very simple:
I need to get the description. As a result, I made such a config, focusing on examples:
The answer I get is this:
The data I get is correct, but I can't take it for an alert. When I check the curl for targets, it's not there.
I've tried different variants of the "path" variable (such as
'$.*' and '{ [*] }'
) but it doesn't work. Please help me figure it out is this a bug or am I doing something wrong?