# Kinana 7.0 - how to create a histogram chart based on latest event in a httpsessionID

**URL:** https://discuss.elastic.co/t/kinana-7-0-how-to-create-a-histogram-chart-based-on-latest-event-in-a-httpsessionid/208479
**Category:** Kibana
**Created:** [November 19, 2019, 9:58am UTC](https://discuss.elastic.co/t/kinana-7-0-how-to-create-a-histogram-chart-based-on-latest-event-in-a-httpsessionid/208479 "2019-11-19T09:58:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cheriemilk](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@cheriemilk](https://discuss.elastic.co/u/cheriemilk)
#### Post date: [November 19, 2019, 9:58am UTC](https://discuss.elastic.co/t/kinana-7-0-how-to-create-a-histogram-chart-based-on-latest-event-in-a-httpsessionid/208479/1 "2019-11-19T09:58:12Z")

</div>

Hi Team,

I have an requirement to create histogram chart based on latest events in a httpsessionID.  
There's multiple events based on a httpsessionID. Sample events like below.

"@timestamp",cn,ci,si,ui,module,fa,at,if1,kf1  
**"November 19th 2019, 07:37:34.824",TALSCMK,TALSCMK,"B266443A8B8F57FFEFF2DC34AB876A3B.mo-5692ea7ca",cgrant1,CAL,MCT,"CAL.MCT.SAVE",161,riskOfLoss**  
"November 19th 2019, 07:32:37.848",TALSCMK,TALSCMK,"B266443A8B8F57FFEFF2DC34AB876A3B.mo-5692ea7ca",cgrant1,CAL,MCT,"CAL.MCT.SAVE",161,"[""riskOfLoss"",""impactOfLoss""]"  
"November 19th 2019, 07:13:03.077",TALSCMK,TALSCMK,"B266443A8B8F57FFEFF2DC34AB876A3B.mo-5692ea7ca",cgrant1,CAL,MCT,"CAL.MCT.SAVE",161,"[""sysOverallPotential"",""sysOverallCompetency""]"  
"November 19th 2019, 07:11:25.237",TALSCMK,TALSCMK,"B266443A8B8F57FFEFF2DC34AB876A3B.mo-5692ea7ca",cgrant1,CAL,MCT,"CAL.MCT.SAVE",161,"[""sysOverallCompetency"",""sysOverallObjective""]"  
**"November 12th 2019, 20:08:39.004",shtCALV1102,shtCALV1102,"3B6C811EC701FE080B9D3971F1EEA5E9.mo-3eb5b0524",lokamoto1,CAL,MCT,"CAL.MCT.SAVE","2,547","[""performanceOverallRating"",""potentialOverallRating"",""rangePenetration""]"**  
**"November 11th 2019, 06:41:12.685",TALCDC16H3,TALCDC16H3,"F26AC2E338DB6EBB0E8E94D88C2DD802.mo-fbba8afe6",cgrant1,CAL,MCT,"CAL.MCT.SAVE",141,"[""objectiveOverallRating"",""sysOverallPerformance"",""sysOverallPotential"",""sysOverallObjective""]"**  
"November 11th 2019, 06:33:34.288",TALCDC16H3,TALCDC16H3,"F26AC2E338DB6EBB0E8E94D88C2DD802.mo-fbba8afe6",cgrant1,CAL,MCT,"CAL.MCT.SAVE",141,"[""objectiveOverallRating"",""sysOverallPerformance"",""sysOverallPotential"",""sysOverallObjective""]"

_ **The visualization requirement is to create histogram chart or pie chart based on the latest events in a httpsessionID which is the bold events above.** _

\*\*\*Metric : count \*\*\*  
_ **Metric by: ktf1** _

I know data table can do this with top hit as metric, but it doesn’t meet the our visualization requirement.  
How to achieve such histogram or pie chart in Kibana?

---

<div class="post-metadata">

### Author: ![alisongoryachev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alisongoryachev/32/111352_2.png) [@alisongoryachev](https://discuss.elastic.co/u/alisongoryachev)
#### Post date: [November 21, 2019, 7:49pm UTC](https://discuss.elastic.co/t/kinana-7-0-how-to-create-a-histogram-chart-based-on-latest-event-in-a-httpsessionid/208479/2 "2019-11-21T19:49:13Z")

</div>

Hi @cheriemilk!

I will try to help here 🙂

On a pie chart, top hits aggregation only works with numbers. There is a [previous Discuss post](https://discuss.elastic.co/t/pie-chart-with-unique-count-and-bucket-aggregation-with-top-hit/178438/2) around a similar issue.

> To use it you have to first create buckets using split slices, and than use the top hit aggregation, that aggregate the top hit results, sorted by the second field on the editor, on each specific bucket with the specified aggregation function (sum, min, max, avg).

---

<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: [December 19, 2019, 7:58pm UTC](https://discuss.elastic.co/t/kinana-7-0-how-to-create-a-histogram-chart-based-on-latest-event-in-a-httpsessionid/208479/3 "2019-12-19T19:58:18Z")

</div>

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