hey there, I am using Heartbeat 8.x and according to
I was trying to check the Sendgrid SMTP service using the public url https://status.sendgrid.com/api/v2/components.json
Using this code:
- type: http id: sendgrid-smtp-status name: Check Sendgrid SMTP fields: component: "sendgrid-smtp-status" schedule: '@every 10s' response.include_body: always tags: ["sendgrid-smtp"] urls: - https://status.sendgrid.com/api/v2/components.json check.request.method: GET check.response: status:  json: - description: Check Sendgrid SMTP status expression: '$.components.status == "operational"'
I can reach my goal. Anyway, if I want to use a more flexible syntax like this one (since I am not sure that SMTP service will be forever at position 4):
expression: '$.components[?(@.name=="SMTP")].status == "operational"'
I will face the error
JSON body did not match 1 expressions or conditions 'rule 'Check Sendgrid SMTP status'($.components[?(@.name=="SMTP")].status == "operational") not matched
Can you explain me the reason?
Furthermore, if I use the following code just to check if SMTP object exists, it works:
expression: '$.components[?(@.name=="SMTP")] != '