# Aggregation on script field

**URL:** <https://discuss.elastic.co/t/aggregation-on-script-field/62298>\
**Category:** Kibana\
**Created:** [October 5, 2016, 5:09pm UTC](https://discuss.elastic.co/t/aggregation-on-script-field/62298 "2016-10-05T17:09:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth\_ramineni](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@srikanth\_ramineni](https://discuss.elastic.co/u/srikanth_ramineni)\
**Post date:** [October 5, 2016, 5:09pm UTC](https://discuss.elastic.co/t/aggregation-on-script-field/62298/1 "2016-10-05T17:09:06Z")

</div>

Hi one below requirement, Can someone can help to for inputs for visualization.

I am looking to visualize the data lines should split by host name and should show graph only one app id with is having more count of records.  
or  
average of count of each appid .

Please let me know if question is not understandable.

data will be like below  
host appid

xxx 123  
xxx 123  
xxx 234  
xxx 234  
xxx 234  
yyy 123  
yyy 123  
yyy 234

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [October 5, 2016, 9:34pm UTC](https://discuss.elastic.co/t/aggregation-on-script-field/62298/2 "2016-10-05T21:34:17Z")

</div>

Sorry, I'm not sure I follow. Perhaps a sketch of the graph you'd like to create would be a helpful example?

---

<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:** [July 6, 2017, 1:37pm UTC](https://discuss.elastic.co/t/aggregation-on-script-field/62298/3 "2017-07-06T13:37:26Z")

</div>


