# EQL: Get only one match (no overlap)

**URL:** <https://discuss.elastic.co/t/eql-get-only-one-match-no-overlap/315014>\
**Category:** Elastic Security\
**Tags:** eql-elastic-query-language\
**Created:** [September 23, 2022, 12:34pm UTC](https://discuss.elastic.co/t/eql-get-only-one-match-no-overlap/315014 "2022-09-23T12:34:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miela](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@miela](https://discuss.elastic.co/u/miela)\
**Post date:** [September 23, 2022, 12:34pm UTC](https://discuss.elastic.co/t/eql-get-only-one-match-no-overlap/315014/1 "2022-09-23T12:34:10Z")

</div>

Hi

Let's consider that we have the following event sequence:  
A, A, A, C, A, B, B, B

now I want a EQL query that matches exactly one A, B sequence, the A, B selection can be arbitrary, i.e., the following are, for instance, valid selections, but other combinations are possible:

- A, A, A, C, [A], [B], B, B
- A, [A], A, C, A, B, B, [B]

I thought I could use the until keyword, as follows:

sequence by ID  
A  
B  
until A

However, this does not return any result. Is it possible to form a EQL query that fulfils my requirements?

---

<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:** [October 21, 2022, 12:34pm UTC](https://discuss.elastic.co/t/eql-get-only-one-match-no-overlap/315014/2 "2022-10-21T12:34:44Z")

</div>

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