-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Change
ctx.payload.hits.total.value
to `ctx.payload.hits.tot…
…al` (#65874) (#66031) Co-authored-by: James Rodewig <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Ernesto Reig <[email protected]>
- Loading branch information
1 parent
e285f45
commit 5cad64c
Showing
10 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ returned any hits: | |
[source,js] | ||
-------------------------------------------------- | ||
"condition" : { | ||
"compare" : { "ctx.payload.hits.total.value" : { "gt" : 0 }} | ||
"compare" : { "ctx.payload.hits.total" : { "gt" : 0 }} | ||
}, | ||
-------------------------------------------------- | ||
// NOTCONSOLE | ||
|
@@ -223,7 +223,7 @@ attaches the payload data to the message: | |
"email" : { <2> | ||
"to" : "[email protected]", | ||
"subject" : "Watcher Notification", | ||
"body" : "{{ctx.payload.hits.total.value}} error logs found", | ||
"body" : "{{ctx.payload.hits.total}} error logs found", | ||
"attachments" : { | ||
"data_attachment" : { | ||
"data" : { | ||
|
@@ -252,7 +252,7 @@ creates a new issue in GitHub | |
"url" : "https://api.github.com/repos/<owner>/<repo>/issues", <1> | ||
"body" : "{ | ||
\"title\": \"Found errors in 'contact.html'\", | ||
\"body\": \"Found {{ctx.payload.hits.total.value}} errors in this page in the last 5 minutes\", | ||
\"body\": \"Found {{ctx.payload.hits.total}} errors in this page in the last 5 minutes\", | ||
\"assignee\": \"web-admin\", | ||
\"labels\": [ \"bug\", \"sev2\" ] | ||
}", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,7 @@ You define the condition with the following script: | |
+ | ||
[source,text] | ||
-------------------------------------------------- | ||
return ctx.payload.hits.total.value > threshold | ||
return ctx.payload.hits.total > threshold | ||
-------------------------------------------------- | ||
+ | ||
If you store the script in a file at `$ES_HOME/config/scripts/threshold_hits.painless`, | ||
|
@@ -204,7 +204,7 @@ PUT _watcher/watch/rss_watch | |
} | ||
} | ||
-------------------------------------------------- | ||
// TEST[s/"id" : "threshold_hits"/"source": "return ctx.payload.hits.total.value > params.threshold"/] | ||
// TEST[s/"id" : "threshold_hits"/"source": "return ctx.payload.hits.total > params.threshold"/] | ||
|
||
<1> Replace `[email protected]` with your email address to receive | ||
notifications. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ PUT _watcher/watch/log_errors | |
} | ||
}, | ||
"condition" : { <4> | ||
"compare" : { "ctx.payload.hits.total.value" : { "gt" : 5 }} | ||
"compare" : { "ctx.payload.hits.total" : { "gt" : 5 }} | ||
}, | ||
"transform" : { <5> | ||
"search" : { | ||
|
@@ -90,13 +90,13 @@ PUT _watcher/watch/log_errors | |
"host" : "mylisteninghost", | ||
"port" : 9200, | ||
"path" : "/{{watch_id}}", | ||
"body" : "Encountered {{ctx.payload.hits.total.value}} errors" | ||
"body" : "Encountered {{ctx.payload.hits.total}} errors" | ||
} | ||
}, | ||
"email_administrator" : { | ||
"email" : { | ||
"to" : "[email protected]", | ||
"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" : { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ SearchInput input = new SearchInput(new WatcherSearchTemplateRequest(new String[ | |
watchSourceBuilder.input(input); | ||
// Set the condition | ||
watchSourceBuilder.condition(new ScriptCondition(new Script("ctx.payload.hits.total.value > 1"))); | ||
watchSourceBuilder.condition(new ScriptCondition(new Script("ctx.payload.hits.total > 1"))); | ||
// Create the email template to use for the action | ||
EmailTemplate.Builder emailBuilder = EmailTemplate.builder(); | ||
|
@@ -78,7 +78,7 @@ PutWatchResponse putWatchResponse2 = watcherClient.preparePutWatch("my-watch") | |
.filter(rangeQuery("date").gt("{{ctx.trigger.scheduled_time}}")) | ||
.filter(rangeQuery("date").lt("{{ctx.execution_time}}")) | ||
).buildAsBytes()))) | ||
.condition(compareCondition("ctx.payload.hits.total.value", CompareCondition.Op.GT, 1L)) | ||
.condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.GT, 1L)) | ||
.addAction("email_someone", emailAction(EmailTemplate.builder() | ||
.to("[email protected]") | ||
.subject("404 recently encountered")))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters