# How to trigger mail in watcher if date&time difference more than 2 sec

**URL:** <https://discuss.elastic.co/t/how-to-trigger-mail-in-watcher-if-date-time-difference-more-than-2-sec/270980>\
**Category:** Logstash\
**Tags:** elastic-stack-alerting\
**Created:** [April 22, 2021, 3:16pm UTC](https://discuss.elastic.co/t/how-to-trigger-mail-in-watcher-if-date-time-difference-more-than-2-sec/270980 "2021-04-22T15:16:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangeshmj1992](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mangeshmj1992](https://discuss.elastic.co/u/mangeshmj1992)\
**Post date:** [April 22, 2021, 3:16pm UTC](https://discuss.elastic.co/t/how-to-trigger-mail-in-watcher-if-date-time-difference-more-than-2-sec/270980/1 "2021-04-22T15:16:36Z")

</div>

Hello all,  
How I can trigger mail in watcher if date&time difference more than 2 sec .  
I have 2 different log line. First log line contain date & time for sent at and second log line contain date & time for received at.

sent at 4/21/2021 7:53:43 AM  
received at 4/21/2021 7:53:41 AM

```
[0915adf2-ff62-421e-97a8-0a00cbb7df7f] [07:53:43 Information] SpotQuote Response : {"ResponseId":"5679ty678","LineItems":[{"QuoteResponseId":"87635204","QuoteId":"G-9a221d-178f4476610-WUSales-2f23fc6-WUBSCTEST-WUSales-1619006023185","SpotRate":437.3374,"CostRate":437.3374,"ForwardPoints":0,"ValidUntilTime":"00:02:00.000","SpotMargin":4.3655,"ForwardPointMargin":0,"Margin":0,"ClientRate":443.8857,"ForwardMargin":0,"IsQuoteTradable":true}]} sent at 4/21/2021 7:53:43 AM 

[0915adf2-ff62-421e-97a8-0a00cbb7df7f] [07:53:41 Information] SpotQuote Request : {"RequestId":"5679ty678","LineItems":[{"QuoteRequestId":"87635204","BuyCurrency":"CAD","SellCurrency":"XOF","DealCurrency":"XOF","SalesCohort":"WUBSCTEST","TreasuryCohort":"WUBSCTESTCORE","ValueDate":"SPOT","Amount":500.0,"Direction":"Sell","MarketConvention":"CAD/XOF"}]} received at 4/21/2021 7:53:41 AM
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 20, 2021, 3:16pm UTC](https://discuss.elastic.co/t/how-to-trigger-mail-in-watcher-if-date-time-difference-more-than-2-sec/270980/2 "2021-05-20T15:16:45Z")

</div>

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