# Prepare the aggregation query according to the first occurence of the events

**URL:** https://discuss.elastic.co/t/prepare-the-aggregation-query-according-to-the-first-occurence-of-the-events/359424
**Category:** Elasticsearch
**Tags:** aggregations
**Created:** [May 14, 2024, 5:03am UTC](https://discuss.elastic.co/t/prepare-the-aggregation-query-according-to-the-first-occurence-of-the-events/359424 "2024-05-14T05:03:23Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [May 14, 2024, 5:16am UTC](https://discuss.elastic.co/t/prepare-the-aggregation-query-according-to-the-first-occurence-of-the-events/359424/3 "2024-05-14T05:16:41Z")

</div>

Opensearch is as the bot says not supported here so I would recommend you reach out the the Opensearch community.

You may also want to have a look at [this old post](https://discuss.elastic.co/t/how-can-i-use-aggregations-to-query-distinct-values-across-all-time-grouped-by-first-seen/25482) for a discussion on what seems to be a very similar problem.

---

_[View the full topic](https://discuss.elastic.co/t/prepare-the-aggregation-query-according-to-the-first-occurence-of-the-events/359424)._
