# How to get hits count as a filed value

**URL:** <https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078>\
**Category:** Kibana\
**Created:** [March 23, 2021, 10:50am UTC](https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078 "2021-03-23T10:50:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![suresh123](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@suresh123](https://discuss.elastic.co/u/suresh123)\
**Post date:** [March 23, 2021, 10:50am UTC](https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078/1 "2021-03-23T10:50:50Z")

</div>

Hello Experts,

When i search a query it gives total hits count in the kibana,  
How to get the same count as a filed which i want to use to Triger the mail.

It would be great if someone helps

Regards,  
Suresh

---

<div class="post-metadata">

**Author:** ![Vadims\_Daleckis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vadims_daleckis/32/57613_2.png) [@Vadims\_Daleckis](https://discuss.elastic.co/u/Vadims_Daleckis)\
**Post date:** [March 23, 2021, 12:16pm UTC](https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078/2 "2021-03-23T12:16:04Z")

</div>

Hi @suresh123 ,

In Kibana 7.12 there will be [Elasticsearch query rule type](https://www.elastic.co/guide/en/kibana/7.12/alert-type-es-query.html), where it will be possible to define triggers based on hit count.

---

<div class="post-metadata">

**Author:** ![suresh123](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@suresh123](https://discuss.elastic.co/u/suresh123)\
**Post date:** [March 23, 2021, 12:35pm UTC](https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078/3 "2021-03-23T12:35:09Z")

</div>

Hi Vadims,

Unfortunately we are not using licensed X pack version, instead using Elastalert.

For example if i search any query it gives 100 hits and showing in Kibana.

I need the same count in a filed that i can use for sending as a alert using Elastalert.

Regards,  
Suresh

---

<div class="post-metadata">

**Author:** ![Vadims\_Daleckis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vadims_daleckis/32/57613_2.png) [@Vadims\_Daleckis](https://discuss.elastic.co/u/Vadims_Daleckis)\
**Post date:** [March 23, 2021, 1:04pm UTC](https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078/4 "2021-03-23T13:04:13Z")

</div>

As I understand Elastalert is developed and maintained by Yelp, not Elastic. In that case, I think you would have a greater chance of finding the answer by asking this question, maybe in [Elastalert GitHub issues](https://github.com/Yelp/elastalert/issues). I am not sure if they have any other dedicated place for questions.

---

<div class="post-metadata">

**Author:** ![suresh123](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@suresh123](https://discuss.elastic.co/u/suresh123)\
**Post date:** [March 23, 2021, 4:27pm UTC](https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078/5 "2021-03-23T16:27:33Z")

</div>

Hi Vadims,

Thanks for your reply.

Is it possible to have a field for getting hits count whenever i search particular query for specific time.

If it is possible using Logstash then i can capture the field from the index leve.

Regards,  
Suresh

---

<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:** [April 20, 2021, 4:28pm UTC](https://discuss.elastic.co/t/how-to-get-hits-count-as-a-filed-value/268078/6 "2021-04-20T16:28:28Z")

</div>

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