Простой вход Watcher
Используйте вход simple для загрузки статических данных в контекст выполнения, когда срабатывает наблюдение. Это позволяет хранить данные централизованно и ссылаться на них с помощью шаблонов.
Вы можете определить статические данные как строку (str), числовое значение (num) или объект (obj):
"input" : {
"simple" : {
"str" : "val1",
"num" : 23,
"obj" : {
"str" : "val2"
}
}
} Например, следующее наблюдение использует вход simple для установки имени получателя для ежедневного напоминания по электронной почте:
{
"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"
}
}
}
}
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/input-simple.html