elasticsearch/docs/reference/watcher/trigger/schedule/daily.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

99 lines
2.6 KiB
Text

[role="xpack"]
[[schedule-daily]]
==== {watcher} Daily schedule
++++
<titleabbrev>Daily schedule</titleabbrev>
++++
A <<trigger-schedule,`schedule`>> that triggers at a particular time
every day. To use the `daily` schedule, you specify the time of day (or times)
when you want the scheduler to start the watch execution with the `at` attribute.
Times are specified in the form `HH:mm` on a 24-hour clock. You can also use the
reserved values `midnight` and `noon` for `00:00` and `12:00`, and
<<specifying-times-using-objects,specify times using objects>>.
NOTE: If you don't specify the `at` attribute for a `daily` schedule, it defaults
to firing once daily at midnight, `00:00`.
===== Configuring a daily schedule
To configure a once a day schedule, you specify a single time with the `at`
attribute. For example, the following `daily` schedule triggers once every
day at 5:00 PM:
[source,js]
--------------------------------------------------
{
"trigger" : {
"schedule" : {
"daily" : { "at" : "17:00" }
}
}
}
--------------------------------------------------
// NOTCONSOLE
===== Configuring a multiple times daily schedule
To configure a `daily` schedule that triggers at multiple times during the day,
you specify an array of times. For example, the following `daily` schedule
triggers at `00:00`, `12:00`, and `17:00` every day.
[source,js]
--------------------------------------------------
{
"trigger" : {
"schedule" : {
"daily" : { "at" : [ "midnight", "noon", "17:00" ] }
}
}
}
--------------------------------------------------
// NOTCONSOLE
[[specifying-times-using-objects]]
===== Specifying times using objects
In addition to using the `HH:mm` string syntax to specify times, you can specify
a time as an object that has `hour` and `minute` attributes.
For example, the following `daily` schedule triggers once every day at 5:00 PM:
[source,js]
--------------------------------------------------
{
"trigger" : {
"schedule" : {
"daily" : {
"at" : {
"hour" : 17,
"minute" : 0
}
}
}
}
}
--------------------------------------------------
// NOTCONSOLE
To specify multiple times using the object notation, you specify multiple hours
or minutes as an array. For example, following `daily` schedule triggers at
`00:00`, `00:30`, `12:00`, `12:30`, `17:00` and `17:30` every day:
[source,js]
--------------------------------------------------
{
"trigger" : {
"schedule" : {
"daily" : {
"at" : {
"hour" : [ 0, 12, 17 ],
"minute" : [0, 30]
}
}
}
}
}
--------------------------------------------------
// NOTCONSOLE