# EQL match event A only if event B does not occur within maxspan

**URL:** <https://discuss.elastic.co/t/eql-match-event-a-only-if-event-b-does-not-occur-within-maxspan/319684>\
**Category:** Elasticsearch\
**Tags:** eql-elastic-query-language\
**Created:** [November 23, 2022, 9:17pm UTC](https://discuss.elastic.co/t/eql-match-event-a-only-if-event-b-does-not-occur-within-maxspan/319684 "2022-11-23T21:17:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jyoung15](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jyoung15/32/100034_2.png) [@jyoung15](https://discuss.elastic.co/u/jyoung15)\
**Post date:** [November 23, 2022, 9:17pm UTC](https://discuss.elastic.co/t/eql-match-event-a-only-if-event-b-does-not-occur-within-maxspan/319684/1 "2022-11-23T21:17:41Z")

</div>

Hi,

My question is similar to [https://discuss.elastic.co/t/creating-alert-when-event-didnt-occur/282195](https://discuss.elastic.co/t/creating-alert-when-event-didnt-occur/282195), which was never really resolved. I'm looking to see if there are any other suggestions how to handle this. Basically we need something like this:

```auto
sequence with maxspan=5m
  [event A]
  [maxspan expires]
until [event B]

```

For those familiar with SEC, this would be like the [PairWithWindow](https://simple-evcorr.github.io/man.html#lbAP) rule where the first action is executed if the second event is not seen within the time window.

Is this possible?

---

<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:** [December 21, 2022, 9:18pm UTC](https://discuss.elastic.co/t/eql-match-event-a-only-if-event-b-does-not-occur-within-maxspan/319684/2 "2022-12-21T21:18:33Z")

</div>

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