How to find top_metrics value in watcher context when dots in field

Hi,

I need some help with the following issue i cannot resolve. Thanks in advance.
Possibly because the field "transaction.duration.us" contains dots i'm not able to get the value isolated in the condition section of the watcher.

QUERY:

         "aggs": {
            "percentiles_calc": {
              "percentiles": {
                "field": "transaction.duration.us",
                "percents": 95,
                "keyed": false
              }
            },
            "last3_hits": {
              "top_metrics": {
                "metrics": {
                  "field": "transaction.duration.us"
                },
                "sort": {
                  "@timestamp": "desc"
                },
                "size": 3
              }
            }
          }
        }
      }
    }
  },
  "condition": {
    "compare": {
      "ctx.payload.aggregations.last3_hits.top.0.metrics": {
        "gt": "{{ctx.payload.aggregations.percentiles_calc.values.0.value}}"
 
QUERY RESULT :

  "aggregations": {
          "percentiles_calc": {
            "values": [
              {
                "value": 724399.9999999987,
                "key": 95
              }
            ]
          },
          "last3_hits": {
            "top": [
              {
                "sort": [ "2021-01-20T13:09:55.306Z"  ],
                "metrics": {
                  "transaction.duration.us": 77000
                }
              },
              {
                "sort": [  "2021-01-20T13:09:25.558Z" ],
                "metrics": {
                  "transaction.duration.us": 305000
                }
              },
              {
                "sort": [ "2021-01-20T13:07:24.159Z" ],
                "metrics": {
                  "transaction.duration.us": 121000

CONDITION RESULT:
     "condition": {
      "type": "compare",
      "status": "success",
      "met": false,
      "compare": {
        "resolved_values": {
          "ctx.payload.aggregations.last3_hits.top.0.metrics": {
            **"transaction.duration.us": 77000**
          },
          "ctx.payload.aggregations.percentiles_calc.values.0.value": 724399.9999999987
        }
      }

It seems like this isn't the complete JSON, seeing the whole thing could be useful. Elastic stack version would be useful as well.

Is this while using the Watcher UI in Kibana - if not the Elasticsearch discuss forum might be more appropriate.

It's not clear to me what the stars around the following text are; I would have expected to see the line without stars, so not clear if you got something different. Did you add them as markdown formatting to make that line bold?

    **"transaction.duration.us": 77000**

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.