# Using JSON Input for an aggregation

**URL:** https://discuss.elastic.co/t/using-json-input-for-an-aggregation/201920
**Category:** Kibana
**Created:** [October 2, 2019, 9:21am UTC](https://discuss.elastic.co/t/using-json-input-for-an-aggregation/201920 "2019-10-02T09:21:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Georg\_Seibt](https://avatars.discourse-cdn.com/v4/letter/g/51bf81/32.png) [@Georg\_Seibt](https://discuss.elastic.co/u/Georg_Seibt)
#### Post date: [October 2, 2019, 9:21am UTC](https://discuss.elastic.co/t/using-json-input-for-an-aggregation/201920/1 "2019-10-02T09:21:59Z")

</div>

Hey,  
I would like to count the events per week but first filter the events for every day on the last event. So basically also if there have been 20 events for one day it should only be counted once for the week. I thought I could make the first aggregation (filtering the last event per day) with the JSON Input field. And the create a bar chart which counts the results aggregated by week.

But I am really not familiarized with the use of JSON input. Can somebody help me? Or is that not supported with JSON input?

Thanks,  
Georg

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [October 4, 2019, 10:58am UTC](https://discuss.elastic.co/t/using-json-input-for-an-aggregation/201920/2 "2019-10-04T10:58:26Z")

</div>

Can you give a better example of what you want to achieve? I think it could be done without the JSON input, but it's pretty hard for me to understand exactly the requirement.

---

<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: [November 1, 2019, 10:58am UTC](https://discuss.elastic.co/t/using-json-input-for-an-aggregation/201920/3 "2019-11-01T10:58:39Z")

</div>

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