# Stats for a query?

**URL:** https://discuss.elastic.co/t/stats-for-a-query/163606
**Category:** Elasticsearch
**Created:** [January 9, 2019, 6:38pm UTC](https://discuss.elastic.co/t/stats-for-a-query/163606 "2019-01-09T18:38:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![elkusr](https://avatars.discourse-cdn.com/v4/letter/e/77aa72/32.png) [@elkusr](https://discuss.elastic.co/u/elkusr)
#### Post date: [January 9, 2019, 6:38pm UTC](https://discuss.elastic.co/t/stats-for-a-query/163606/1 "2019-01-09T18:38:52Z")

</div>

Hi all, new to Elasticsearch, primarily use Splunk. I'm looking to generate stats for some queries. For example:

EVENTNAME:"Prevent DLLs from jumping over rainbows"

In Splunk if I wanted to see all event names captured in logs for a certain index, at a high level I would do:

index=endpointsecurity (for example) | stats count by EVENTNAME

And a stats table would be presented with all event names observed over the last x amount of time for endpoint security logs, along with a "count" column showing how many times each event name was observed. Did some research and couldn't find out if this is possible in Elasticsearch / Lucene. Any help is appreciated.

---

<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: [February 6, 2019, 6:44pm UTC](https://discuss.elastic.co/t/stats-for-a-query/163606/2 "2019-02-06T18:44:50Z")

</div>

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