简单输入
Elastic Stack Serverless
使用 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"
}
}
}
}