I am using Inifinity plugin with Backend as the parser, in the dashboard panel I am using some query and it is working fine, the same query I am trying to use while creating alerts is not working and giving below error:
Let me explain you my requirement first, in my grafana dashboard infinity panel I wanted a new dynamic field “Delay Hours” which I created with Jsonata query using parser as ‘Backend’ and it works fine,
Panel query looks something like below :
(hits.hits._source).{'orderCreatedDate': orderCreatedDate, 'refundStatus':refundStatus,'returnDeliveryedTime':returnDeliveryedTime,,'delayHours':($millis()-$toMillis($replace(returnDeliveryedTime, ' ', 'T'))) / 3600000 and so on}
Also I need to create an Alert, but the issue is I need to use the “refundStatus” and ‘delayHours’ as a filter conditions but since ‘delayHours’ is calculated dynamically in the panel and it is not present in the elasticsearch index I need to do replicate same query first for the Alert Rule creation since there is no delayHours in elasticsearch, so I am using the same query again
(hits.hits._source).{'orderCreatedDate': orderCreatedDate, 'refundStatus':refundStatus,'returnDeliveryedTime':returnDeliveryedTime,,'delayHours':($millis()-$toMillis($replace(returnDeliveryedTime, ' ', 'T'))) / 3600000 and so on}
but the problem is the above query is failing firstly.
Do I understand the limitations documentation correctly that for alerting I can only use the “backend” parser which seems to support only JSONPath?
Otherwise UQL would be a way to go using something like
parse_json | jsonata "<jsonata_expression>"
Edit: Overall I’m a little confused, because the Rows/Root placeholder text says “JSONata / rows selector” and in the backend parser documentation I read that the rows selector is gjson…