# Threshold rule

**URL:** <https://discuss.elastic.co/t/threshold-rule/336528>\
**Category:** SIEM\
**Created:** [June 21, 2023, 4:52am UTC](https://discuss.elastic.co/t/threshold-rule/336528 "2023-06-21T04:52:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bex](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@bex](https://discuss.elastic.co/u/bex)\
**Post date:** [June 21, 2023, 4:52am UTC](https://discuss.elastic.co/t/threshold-rule/336528/1 "2023-06-21T04:52:01Z")

</div>

Hello everyone

I would like to clarify.

For example, I am trying to add threshold rule against login failed attempt  
If user failes more than 4 times, I should get an alert

 ![threshold](https://us1.discourse-cdn.com/elastic/original/3X/d/d/dd8ff363e311623bcfb0e5c4cb98fc990f4b0b97.jpeg)

From the picture above, I am grouping by "**winlolg.event\_data.ipAddress(source.ip)**" and indicating the threshold to \>=4.  
Also indicated the count the "**winlog.event\_data.Substatus(wrong password)**" \>= 1

I think, should it be vise versa?  
I think, the structure of the threshold rule is incorrect.  
For example, it should be:  
group by "**winlolg.event\_data.ipAddress(source.ip)** \>= unique values 1 and  
count "**winlog.event\_data.Substatus(wrong password)**" \>= threshold 4

Can someone please help the right way?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 22, 2023, 4:19am UTC](https://discuss.elastic.co/t/threshold-rule/336528/2 "2023-06-22T04:19:27Z")

</div>

> [@bex](#):
>
> group by "**winlolg.event\_data.ipAddress(source.ip)** \>= unique values 1 and  
> count "**winlog.event\_data.Substatus(wrong password)**" \>= threshold 4

Yep that way makes more sense.

---

<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:** [July 20, 2023, 4:19am UTC](https://discuss.elastic.co/t/threshold-rule/336528/3 "2023-07-20T04:19:55Z")

</div>

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