Skip to content

Instantly share code, notes, and snippets.

@renshuki
Created April 8, 2020 06:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Elasticsearch / Watcher - Watcher to retrieve number of shards from _cluster/health
{
  "trigger": {
    "schedule": {
      "interval": "30m"
    }
  },
  "input" : {
    "http" : {
      "request" : {
        "host" : "localhost",
        "port" : 9200,
        "path" : "_cluster/health"
      }
    }
  },
  "actions": {
    "my-logging-action": {
      "logging": {
        "text": "There are {{ctx.payload.active_shards}} shards."
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment