# Aggregation of individual array elements

**URL:** <https://discuss.elastic.co/t/aggregation-of-individual-array-elements/353207>\
**Category:** Kibana\
**Created:** [February 13, 2024, 7:59pm UTC](https://discuss.elastic.co/t/aggregation-of-individual-array-elements/353207 "2024-02-13T19:59:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeremyP](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@JeremyP](https://discuss.elastic.co/u/JeremyP)\
**Post date:** [February 13, 2024, 7:59pm UTC](https://discuss.elastic.co/t/aggregation-of-individual-array-elements/353207/1 "2024-02-13T19:59:00Z")

</div>

Hello,

I need some advice on how to proceed. I'm trying to visualize some trending I have from an asset discovery tool. Each time the asset is discovered a new array element is added the Elasticsearch document. Here is a sample of the data....

```auto
    "asset": {
      "scan_history": [
        {
          "scan_time": "2024-01-13T02:21:08.448Z",
          "state": "active",
        },
        {
          "state": "remediated",
          "scan_time": "2024-02-10T03:17:28.275413292Z",
        }

```

I'm using an area graph, with a data histogram set to a 1M interval. I'd like to report on "state" for each month. For the months of January and February, I'm seeing a count of 1 active and 1 remediated for January and February.

Can anyone recommend the best way of moving forward to treat each array element individually vs. treating the array as a single bucket?

Thank you.

---

<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:** [March 12, 2024, 7:59pm UTC](https://discuss.elastic.co/t/aggregation-of-individual-array-elements/353207/2 "2024-03-12T19:59:37Z")

</div>

Closed on March 12, 2024, 7:59pm UTC

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