# Using JSON input of Kibana Visualizations as filters

**URL:** <https://discuss.elastic.co/t/using-json-input-of-kibana-visualizations-as-filters/202327>\
**Category:** Kibana\
**Created:** [October 4, 2019, 10:50am UTC](https://discuss.elastic.co/t/using-json-input-of-kibana-visualizations-as-filters/202327 "2019-10-04T10:50:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shan\_Chathusanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shan_chathusanda/32/55382_2.png) [@Shan\_Chathusanda](https://discuss.elastic.co/u/Shan_Chathusanda)\
**Post date:** [October 4, 2019, 10:50am UTC](https://discuss.elastic.co/t/using-json-input-of-kibana-visualizations-as-filters/202327/1 "2019-10-04T10:50:51Z")

</div>

Hi all,

I am very new to ELK stack and I have the following requirement. I need to create a vertical bar visualization with two metrics (assume metricA and metricB). I have a common condition (a string) which can divide these two (assume the condition as conditionC : "True"). I tried this by adding a JSON input, but it did not work. So I need to know that can this requirement be successfully implemented from a vertical bar visualization? Following is the JSON input that I have used.  
{  
"script": {  
"type":"string",  
"inline": "doc['conditionA'].value='True'",  
"lang": "painless"  
}  
}

---

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [October 8, 2019, 2:21pm UTC](https://discuss.elastic.co/t/using-json-input-of-kibana-visualizations-as-filters/202327/2 "2019-10-08T14:21:49Z")

</div>

@Shan_Chathusanda I'm not sure if I understood the question correctly, but sounds to me that what you want is to split series with a filters aggregation where you can select the correct KQL filter to apply. Have you tried that?

---

<div class="post-metadata">

**Author:** ![Shan\_Chathusanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shan_chathusanda/32/55382_2.png) [@Shan\_Chathusanda](https://discuss.elastic.co/u/Shan_Chathusanda)\
**Post date:** [October 9, 2019, 11:28am UTC](https://discuss.elastic.co/t/using-json-input-of-kibana-visualizations-as-filters/202327/3 "2019-10-09T11:28:01Z")

</div>

Hi @tiagocosta  
I will clarify it like this. Think there are two metrics (Actually there are 2 Y-axis). I need those two metrics to be filtered in individual filters. One filter cannot affect to other metric values. The point I was going to provide is that do we can use the JSON input field of Kibana visualization to do this requirement. Hope you understand my requirement.  
Regards.

---

<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 6, 2019, 11:28am UTC](https://discuss.elastic.co/t/using-json-input-of-kibana-visualizations-as-filters/202327/4 "2019-11-06T11:28:02Z")

</div>

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