# Get the hit count in EQL

**URL:** https://discuss.elastic.co/t/get-the-hit-count-in-eql/335529
**Category:** Elasticsearch
**Created:** [June 8, 2023, 12:00pm UTC](https://discuss.elastic.co/t/get-the-hit-count-in-eql/335529 "2023-06-08T12:00:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sanju1323](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sanju1323](https://discuss.elastic.co/u/sanju1323)
#### Post date: [June 8, 2023, 12:00pm UTC](https://discuss.elastic.co/t/get-the-hit-count-in-eql/335529/1 "2023-06-08T12:00:25Z")

</div>

Hi,

I'm using the EQL queries for my search and want to get the `hits.total.value` .  
When I try the below query, i'm getting the hits.total.value as 10. But I'm not getting the total count of the hits for the search.

> GET logstash-test/\_eql/search  
> {  
> "query": "any where isalarm =="1""  
> }

Can someone please help me in getting hit count for the query. (Like I have 167543 hits matching for the above query. I have tried using fetch\_size as well but that is not giving me the total count of 167543)

---

<div class="post-metadata">

### Author: ![Priscilla\_Parodi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priscilla_parodi/32/43047_2.png) [@Priscilla\_Parodi](https://discuss.elastic.co/u/Priscilla_Parodi)
#### Post date: [June 28, 2023, 7:44pm UTC](https://discuss.elastic.co/t/get-the-hit-count-in-eql/335529/2 "2023-06-28T19:44:20Z")

</div>

Hello @sanju1323,

By default, the `size` parameter is set to `10`, which determines the maximum number of matching events that will be returned. Have you tried setting a higher value for the `size` parameter to get more hits?

```auto
GET logstash-test/_eql/search
{
   "query": "...",
   "size": ...
}

```

---

<div class="post-metadata">

### Author: ![sanju1323](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sanju1323](https://discuss.elastic.co/u/sanju1323)
#### Post date: [June 30, 2023, 5:42am UTC](https://discuss.elastic.co/t/get-the-hit-count-in-eql/335529/3 "2023-06-30T05:42:48Z")

</div>

Hi @Priscilla_Parodi,

Thanks for the update.  
I have tried giving "size" as higher number. But we need the count of all the matching results.  
Which means, if I have 20,000 hits, I want all the hits.

Please suggest.

Thanks

---

<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 28, 2023, 5:42am UTC](https://discuss.elastic.co/t/get-the-hit-count-in-eql/335529/4 "2023-07-28T05:42:54Z")

</div>

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