# How to find the number of times a particular log event happened in the ES using query

**URL:** <https://discuss.elastic.co/t/how-to-find-the-number-of-times-a-particular-log-event-happened-in-the-es-using-query/133954>\
**Category:** Elasticsearch\
**Created:** [May 30, 2018, 11:09pm UTC](https://discuss.elastic.co/t/how-to-find-the-number-of-times-a-particular-log-event-happened-in-the-es-using-query/133954 "2018-05-30T23:09:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubul](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@dubul](https://discuss.elastic.co/u/dubul)\
**Post date:** [May 30, 2018, 11:09pm UTC](https://discuss.elastic.co/t/how-to-find-the-number-of-times-a-particular-log-event-happened-in-the-es-using-query/133954/1 "2018-05-30T23:09:35Z")

</div>

I'm trying to run a query to find the matching text in a message field and I'm trying to gather the results from the response to analyse the number of such events happening.

```
query = {
      "query": {
        "match": { "message": "Job failed abruptly. Need to rerun the job as soon as possible" }
      }
    }

```

How to find the the number of such failed events happened based search query? Any suggestions?

---

<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:** [June 27, 2018, 11:09pm UTC](https://discuss.elastic.co/t/how-to-find-the-number-of-times-a-particular-log-event-happened-in-the-es-using-query/133954/2 "2018-06-27T23:09:36Z")

</div>

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