elasticsearch/docs/reference/watcher/input/simple.asciidoc
James Rodewig 255c9a7f95
[DOCS] Move x-pack docs to docs/reference dir (#99209)
**Problem:**
For historical reasons, source files for the Elasticsearch Guide's security, watcher, and Logstash API docs are housed in the `x-pack/docs` directory. This can confuse new contributors who expect Elasticsearch Guide docs to be located in `docs/reference`. 

**Solution:**
- Move the security, watcher, and Logstash API doc source files to the `docs/reference` directory
- Update doc snippet tests to use security

Rel: https://github.com/elastic/platform-docs-team/issues/208
2023-09-12 14:53:41 -04:00

56 lines
No EOL
1.2 KiB
Text

[role="xpack"]
[[input-simple]]
=== {watcher} simple input
++++
<titleabbrev>Simple input</titleabbrev>
++++
Use the `simple` input to load static data into the execution
context when the watch is triggered. This enables you to store the data
centrally and reference it with templates.
You can define the static data as a string (`str`), numeric value (`num`), or
an object (`obj`):
[source,js]
--------------------------------------------------
"input" : {
"simple" : {
"str" : "val1",
"num" : 23,
"obj" : {
"str" : "val2"
}
}
}
--------------------------------------------------
// NOTCONSOLE
For example, the following watch uses the `simple` input to set the recipient
name for a daily reminder email:
[source,js]
--------------------------------------------------
{
"trigger" : {
"schedule" : {
"daily" : { "at" : "noon" }
}
},
"input" : {
"simple" : {
"name" : "John"
}
},
"actions" : {
"reminder_email" : {
"email" : {
"to" : "to@host.domain",
"subject" : "Reminder",
"body" : "Dear {{ctx.payload.name}}, by the time you read these lines, I'll be gone"
}
}
}
}
--------------------------------------------------
// NOTCONSOLE