原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/input-simple.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/input-simple.html
本地英文版地址: ../en/input-simple.html
重要: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 当前版本文档。
Simple inputedit
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
):
"input" : { "simple" : { "str" : "val1", "num" : 23, "obj" : { "str" : "val2" } } }
For example, the following watch uses the simple
input to set the recipient
name for a daily reminder email:
{ "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" } } } }