# Brute Force query in ELK

**URL:** <https://discuss.elastic.co/t/brute-force-query-in-elk/75726>\
**Category:** Elasticsearch\
**Created:** [February 20, 2017, 12:12pm UTC](https://discuss.elastic.co/t/brute-force-query-in-elk/75726 "2017-02-20T12:12:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ANU\_SARA\_VARGHESE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anu_sara_varghese/32/51487_2.png) [@ANU\_SARA\_VARGHESE](https://discuss.elastic.co/u/ANU_SARA_VARGHESE)\
**Post date:** [February 20, 2017, 12:12pm UTC](https://discuss.elastic.co/t/brute-force-query-in-elk/75726/1 "2017-02-20T12:12:04Z")

</div>

Hi,

I am trying to create a successful brute force attempts. For that I am writing a ruby code in logstash.

Is there any other method like writing a query in elasticsearch, so that I could meet the logic of the successful brute force attempt [Brute force attempt by a particular user on a particular IP]?

I have already created many filters in my logstash and I don't want to overload it. I have tried the query in kibana but I am not able to meet it there.

---

<div class="post-metadata">

**Author:** ![nellicus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nellicus/32/51566_2.png) [@nellicus](https://discuss.elastic.co/u/nellicus)\
**Post date:** [February 20, 2017, 12:44pm UTC](https://discuss.elastic.co/t/brute-force-query-in-elk/75726/2 "2017-02-20T12:44:59Z")

</div>

I am not sure why you'd want to write ruby in Logstash to achieve brute force detection.

I'd suggest taking a look at Elasticsearch Terms Aggregations combined with Alerting.

Also see this [blog](https://www.elastic.co/blog/elasticsearch-and-siem-implementing-host-portscan-detection) re portscan detection (logic can be adapted for failed bruteforce login).

---

<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:** [March 20, 2017, 12:46pm UTC](https://discuss.elastic.co/t/brute-force-query-in-elk/75726/3 "2017-03-20T12:46:03Z")

</div>

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