Spec-Zone.ru › Elasticsearch 7
›Elasticsearch Guide [7.17] ›Watcher ›Watcher inputs

Watcher simple input

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"
      }
    }
  }
}

© 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/7.17/input-simple.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API