Skip to content

Instantly share code, notes, and snippets.

@michaelkeevildown
Last active February 14, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelkeevildown/133cb26142c905c5042ef176f711b71a to your computer and use it in GitHub Desktop.
Save michaelkeevildown/133cb26142c905c5042ef176f711b71a to your computer and use it in GitHub Desktop.
Watcher - v2.3 - Example
{
"trigger": {
"schedule": {
"interval": "1m"
}
},
"input": {
"search": {
"request": {
"indices": "##INDEX##",
"types": "##TYPE##",
"body": {
##QUERY IN HERE##
}
}
}
},
"throttle_period": "30m", ## Not sure if you want this###
"condition": {
"compare" : { "ctx.payload.hits.total" : { "gt" : 0 }}
},
"actions": {
"index_payload" : {
"index": "##INDEX NAME HERE##",
"doc_type": "## TYPE HERE##"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment