# X-pack license email triggering

**URL:** <https://discuss.elastic.co/t/x-pack-license-email-triggering/97849>\
**Category:** Elasticsearch\
**Created:** [August 22, 2017, 5:23am UTC](https://discuss.elastic.co/t/x-pack-license-email-triggering/97849 "2017-08-22T05:23:27Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mhgeay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhgeay/32/21365_2.png) [@mhgeay](https://discuss.elastic.co/u/mhgeay)\
**Post date:** [August 22, 2017, 11:37am UTC](https://discuss.elastic.co/t/x-pack-license-email-triggering/97849/6 "2017-08-22T11:37:40Z")

</div>

In your posted watch, the trigger (when) is too small, should be daily ; then the input is missing (what search) and to apply action (index, email, API...) on specific conditions, use conditions : when the condition(s) is/are true (= met), action will be applied.  
You should read the [watcher doc](https://www.elastic.co/guide/en/x-pack/5.5/how-watcher-works.html) and [compare](https://www.elastic.co/guide/en/x-pack/5.5/condition-compare.html) conditions doc I linked before. You have good examples on Elastic GitHub [repo](https://github.com/elastic/examples/tree/master/Alerting/Sample%20Watches).

I didn't test my tips/example, so it can be inaccurate.  
instead se of ctx.execution\_time value, try to use a date variable (\<{now+30d}\>) in the condition part :

```
{
  "condition" : {
    "compare" : {
      "ctx.payload.expiry_date" : {
        "lte" : "<{now+30d}>"
      }
  }
}

```

The expiration warning in on Monitoring view as [mentioned](https://discuss.elastic.co/t/the-license-a-stab-in-the-dark/69158/2) by Elastic team in the topic you linked :

> Today, we show this information at the top of the Monitoring Cluster Overview screen, which you can click to see more details, including a link to the subscriptions page above

---

_[View the full topic](https://discuss.elastic.co/t/x-pack-license-email-triggering/97849)._
