Watcher input, simple query without body

Hi I wanto to run a Watch with the disk space available in a node, but I dont know how to use this query:

GET _cat/nodes?h=h,diskAvail

in the context of the Watcher input, because this query has no body, no indices to use, nor timestamp.

How can I do this?
Example of a normal Watcher input

"input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "index*"
        ],
        "rest_total_hits_as_int": true,
        "body": {
          "size": 0,
          "query": {
            "bool": {
              "filter": {
                "range": {
                  "@timestamp": {
                    "gte": "{{ctx.trigger.scheduled_time}}||-5m",
                    "lte": "{{ctx.trigger.scheduled_time}}",
                    "format": "strict_date_optional_time||epoch_millis"
                  }
                }
              }
            }
          }
        }
      }
    }
  },````

Hi!
Instead of search input, you can use http input

There is a related example in the documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/watch-cluster-status.html

If you use monitoring, there is also a related example that leverages the internal indexes used for that feature and search input:

1 Like

Gracias Andres!

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