How can I setup in Watcher to send out an email depend on the Search condition?

Hi,

In my Watcher, I setup a template below to send out an email base on the search condition, it works. However, I have different Indices and Tags that I want to put all together in one Watcher. For example,

  1. If IndexA and TagA have no record, send email with Subject "No IndexA and TagA."
  2. If IndexA and TagB have no record, send email with Subject "No IndexA and TagB."
  3. If IndexB and TagC have no record, send email with Subject "No IndexB and TagC."
  4. If IndexB and TagD have no record, send email with Subject "No IndexB and TagD."

I have tried to add another "input", "condition" and "email" section after the template, but it does not work, how can I accomplish my requirements? Do I need to create each requirement for each Watcher? Please advise.

{
"trigger": {
"schedule": {
...
},
"input": {
"search": {
...
},
"condition": {
...
},
"actions": {
"send_email": {
"email": {
...
}
}
}

Hi @Shaw,

Let me see if @alisongoryachev can help here?

Thanks.

Thank you @LizaD.

Hi @Shaw! You can only define one input and condition in the watcher payload.

Would the chain input approach help you with this? Also, have you tried using a script condition?

Thank you @alisongoryachev! I will check out the chain input and script condition.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.