# Pie chart or vertical bar

**URL:** https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385
**Category:** Kibana
**Created:** [August 22, 2019, 6:35pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385 "2019-08-22T18:35:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mouli](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mouli](https://discuss.elastic.co/u/mouli)
#### Post date: [August 22, 2019, 6:35pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385/1 "2019-08-22T18:35:45Z")

</div>

Hi, I am very new to Kibana. I have a use case where we have to get a bar or pie chart and below are the values for one of the attribute requested.path is:

[google.com/images](http://google.com/images)  
[google.com/images/a](http://google.com/images/a)  
[google.com/images/b](http://google.com/images/b)  
[google.com/images/c](http://google.com/images/c)  
[google.com/images/d](http://google.com/images/d)  
[google.com/videos/video-1](http://google.com/videos/video-1)  
[google.com/videos/video-2](http://google.com/videos/video-2)  
[google.com/videos/video-3](http://google.com/videos/video-3)  
[google.com/videos/video-4](http://google.com/videos/video-4)  
[google.com/maps/map1](http://google.com/maps/map1)  
[google.com/maps/map2](http://google.com/maps/map2)  
[google.com/maps/map3](http://google.com/maps/map3)

how do I get a value

The charts should be a count like below  
// [google.com/images:](http://google.com/images:) 4  
// [google.com/videos](http://google.com/videos) : 4  
// [google.com/maps:](http://google.com/maps:) 3

How can I achieve this visualization?  
I've tried filtering with filters like below  
{  
"query": {  
"match": {  
"requested.path": {  
"query": "[google.com/\*](http://google.com/*)",  
"type": "phrase"  
}  
}  
}  
}

But the above is treating everything including google/images as separate entries. I am not getting output as expected.

---

<div class="post-metadata">

### Author: ![tims](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tims/32/46750_2.png) [@tims](https://discuss.elastic.co/u/tims)
#### Post date: [August 22, 2019, 6:39pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385/2 "2019-08-22T18:39:31Z")

</div>

Hi @mouli, this video is an older version of Kibana but the basic actions should be similar to what you want. Try this: [https://www.elastic.co/videos/kibana-4-tutorial-part-1-creating-pie-charts](https://www.elastic.co/videos/kibana-4-tutorial-part-1-creating-pie-charts)

---

<div class="post-metadata">

### Author: ![mouli](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mouli](https://discuss.elastic.co/u/mouli)
#### Post date: [August 22, 2019, 6:53pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385/3 "2019-08-22T18:53:37Z")

</div>

Hi @tims Thank you for pointing me to the video. The key is the same(requested.path) but the values are different as below:

[google.com/images](http://google.com/images)  
[google.com/images/a](http://google.com/images/a)  
[google.com/images/b](http://google.com/images/b)  
[google.com/images/c](http://google.com/images/c)  
[google.com/images/d](http://google.com/images/d)  
[google.com/videos/video-1](http://google.com/videos/video-1)  
[google.com/videos/video-2](http://google.com/videos/video-2)  
[google.com/videos/video-3](http://google.com/videos/video-3)  
[google.com/videos/video-4](http://google.com/videos/video-4)  
[google.com/maps/map1](http://google.com/maps/map1)  
[google.com/maps/map2](http://google.com/maps/map2)  
[google.com/maps/map3](http://google.com/maps/map3)

I have only one single key with all the different values. @tims couldn't understand filters in my case and looking for help regarding the same. Please let me know if I am not clear with my question 🙂

---

<div class="post-metadata">

### Author: ![tims](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tims/32/46750_2.png) [@tims](https://discuss.elastic.co/u/tims)
#### Post date: [August 22, 2019, 7:56pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385/4 "2019-08-22T19:56:21Z")

</div>

Yes, so if you use the terms aggregation and set the field as requested.path it should split them out for you in the chart. Does that help?

---

<div class="post-metadata">

### Author: ![mouli](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mouli](https://discuss.elastic.co/u/mouli)
#### Post date: [August 22, 2019, 8:16pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385/5 "2019-08-22T20:16:51Z")

</div>

@tims, Actually no. I have been using the same way you mentioned, but it is splitting into 12 individual entities rather than 3 entries like we want  
// [google.com/images:](http://google.com/images:) 4  
// [google.com/videos](http://google.com/videos) : 4  
// [google.com/maps:](http://google.com/maps:) 3

---

<div class="post-metadata">

### Author: ![tims](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tims/32/46750_2.png) [@tims](https://discuss.elastic.co/u/tims)
#### Post date: [August 22, 2019, 8:30pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385/6 "2019-08-22T20:30:53Z")

</div>

Ah ok, I understand now, unfortunately the only way I can think of to accomplish this would be to just modify your data structure on ingest to acommodate this. Some kind of tag that gets set based on a regex against your url.

---

<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: [September 19, 2019, 8:30pm UTC](https://discuss.elastic.co/t/pie-chart-or-vertical-bar/196385/7 "2019-09-19T20:30:54Z")

</div>

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