From 584cb0d926cb534890010937fde787d25daa42cb Mon Sep 17 00:00:00 2001 From: Florian Kelbert Date: Thu, 16 Jan 2020 15:34:25 +0100 Subject: [PATCH] [DOCS] Correctly read total hits inside watcher config (#50614) With elastic/elasticsearch#35848, users can now retrieve total hits as an integer when the `rest_total_hits_as_int` query parameter is `true`. This is the default value. This updates several snippet examples in the Watcher docs that used a workaround to get a total hits integer. --- x-pack/docs/en/watcher/actions.asciidoc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/x-pack/docs/en/watcher/actions.asciidoc b/x-pack/docs/en/watcher/actions.asciidoc index e140e622d304c..6e0a8c6efb377 100644 --- a/x-pack/docs/en/watcher/actions.asciidoc +++ b/x-pack/docs/en/watcher/actions.asciidoc @@ -69,14 +69,14 @@ PUT _watcher/watch/error_logs_alert } }, "condition" : { - "compare" : { "ctx.payload.hits.total.value" : { "gt" : 5 }} + "compare" : { "ctx.payload.hits.total" : { "gt" : 5 }} }, "actions" : { "email_administrator" : { "throttle_period": "15m", <1> "email" : { <2> "to" : "sys.admino@host.domain", - "subject" : "Encountered {{ctx.payload.hits.total.value}} errors", + "subject" : "Encountered {{ctx.payload.hits.total}} errors", "body" : "Too many error in the system, see attached data", "attachments" : { "attached_data" : { @@ -119,14 +119,14 @@ PUT _watcher/watch/log_event_watch } }, "condition" : { - "compare" : { "ctx.payload.hits.total.value" : { "gt" : 5 }} + "compare" : { "ctx.payload.hits.total" : { "gt" : 5 }} }, "throttle_period" : "15m", <1> "actions" : { "email_administrator" : { "email" : { "to" : "sys.admino@host.domain", - "subject" : "Encountered {{ctx.payload.hits.total.value}} errors", + "subject" : "Encountered {{ctx.payload.hits.total}} errors", "body" : "Too many error in the system, see attached data", "attachments" : { "attached_data" : { @@ -144,7 +144,7 @@ PUT _watcher/watch/log_event_watch "host" : "pager.service.domain", "port" : 1234, "path" : "/{{watch_id}}", - "body" : "Encountered {{ctx.payload.hits.total.value}} errors" + "body" : "Encountered {{ctx.payload.hits.total}} errors" } } } @@ -265,13 +265,13 @@ PUT _watcher/watch/log_event_watch } }, "condition" : { - "compare" : { "ctx.payload.hits.total.value" : { "gt" : 0 } } + "compare" : { "ctx.payload.hits.total" : { "gt" : 0 } } }, "actions" : { "email_administrator" : { "email" : { "to" : "sys.admino@host.domain", - "subject" : "Encountered {{ctx.payload.hits.total.value}} errors", + "subject" : "Encountered {{ctx.payload.hits.total}} errors", "body" : "Too many error in the system, see attached data", "attachments" : { "attached_data" : { @@ -285,14 +285,14 @@ PUT _watcher/watch/log_event_watch }, "notify_pager" : { "condition": { <1> - "compare" : { "ctx.payload.hits.total.value" : { "gt" : 5 } } + "compare" : { "ctx.payload.hits.total" : { "gt" : 5 } } }, "webhook" : { "method" : "POST", "host" : "pager.service.domain", "port" : 1234, "path" : "/{{watch_id}}", - "body" : "Encountered {{ctx.payload.hits.total.value}} errors" + "body" : "Encountered {{ctx.payload.hits.total}} errors" } } }