# How to add custom queries in one visualization?

**URL:** https://discuss.elastic.co/t/how-to-add-custom-queries-in-one-visualization/102458
**Category:** Kibana
**Created:** [October 2, 2017, 5:07pm UTC](https://discuss.elastic.co/t/how-to-add-custom-queries-in-one-visualization/102458 "2017-10-02T17:07:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mounika](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mounika](https://discuss.elastic.co/u/mounika)
#### Post date: [October 2, 2017, 5:07pm UTC](https://discuss.elastic.co/t/how-to-add-custom-queries-in-one-visualization/102458/1 "2017-10-02T17:07:49Z")

</div>

Hi,

I have the below scenario, how to apply this scenario in one visualization?

I have a component and different values in that component. each has unique name, I want to group the same set of names in one pie chart.

for eg- I have a component name - jobname and have 60 unique names but 17 jobs name start with the same name like (abcd\_1, abcd\_2, abcd\_3, ...) and another set of 20 jobs name will be like ( xyz\_1, xyz\_2, xyz\_3, ...) and few more job names would be (test\_1, test\_2, test\_3). how can I show category 1 , category 2 , category 3 in the same pie chart.

can someone please help me with this?

Thanks

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [October 4, 2017, 5:50pm UTC](https://discuss.elastic.co/t/how-to-add-custom-queries-in-one-visualization/102458/2 "2017-10-04T17:50:49Z")

</div>

You could split by "filters" aggregation, then use `abcd_*` for the first filter, `xyz_*` for the second, etc.

---

<div class="post-metadata">

### Author: ![mounika](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mounika](https://discuss.elastic.co/u/mounika)
#### Post date: [October 6, 2017, 1:51pm UTC](https://discuss.elastic.co/t/how-to-add-custom-queries-in-one-visualization/102458/3 "2017-10-06T13:51:13Z")

</div>

This works Thanks

---

<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 3, 2017, 1:51pm UTC](https://discuss.elastic.co/t/how-to-add-custom-queries-in-one-visualization/102458/4 "2017-11-03T13:51:24Z")

</div>

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