# How to Visualize 1 as Yes and 0 as No

**URL:** <https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535>\
**Category:** Kibana\
**Created:** [March 12, 2018, 11:20am UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535 "2018-03-12T11:20:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 12, 2018, 11:20am UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/1 "2018-03-12T11:20:30Z")

</div>

Hi,  
I'm new to Kibana.

I'm on kibana 6.0.  
I have some fields (total 8 fields) which are either 1 or 0 which basically means Yes or No. How can i display this type of data in Kibana as Yes/No or UP/Down accordingly .

Should i be using JSON input to write any IF statements? Kindly help.

Thanks,  
Sahadev

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [March 12, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/2 "2018-03-12T14:30:36Z")

</div>

Hey @sahadevgd a [Scripted Field](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) is your best bet.

---

<div class="post-metadata">

**Author:** ![emil.mirzayev](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@emil.mirzayev](https://discuss.elastic.co/u/emil.mirzayev)\
**Post date:** [March 12, 2018, 2:38pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/3 "2018-03-12T14:38:48Z")

</div>

Hi @sahadevgd, if you have quite a big amount of data, scripting may reduce the speed of your queries. If you are feeding data via **logstash** , you can index those documents already with desired fields and values.

---

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 12, 2018, 2:49pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/4 "2018-03-12T14:49:57Z")

</div>

Hi @emil.mirzayev Thanks for your reply. We are feeding the data via logstash. The first method we tried is by sending the data to Kibana as Up and Down instead of 1 and 0. But we were unable to find the right way to visualize this type of data hence converted it to 1 and 0 and feeding it.

Kindly suggest how to visualize Text and show Up as Green and Down as Red with respect to timestamp.

---

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 12, 2018, 2:50pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/5 "2018-03-12T14:50:29Z")

</div>

Hi @Brandon_Kobel, thanks, i'll have a look at this.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [March 12, 2018, 2:54pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/6 "2018-03-12T14:54:33Z")

</div>

@sahadevgd if you're just wanting to do this for a few visualizations, you can also use the Filter aggregation to do something similar to:

 ![59%20AM](https://us1.discourse-cdn.com/elastic/original/3X/6/a/6ac8d212d60c5c48f32b46229080cb066042818e.png)

---

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 12, 2018, 4:10pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/7 "2018-03-12T16:10:35Z")

</div>

@Brandon_Kobel I was able to get this using the Goal type but when the value is 0, i'm unable to display it. I've tried the range as 0-1 and also 0-0 but still when the value is 0, the graph doesn't show up.

I have certain env's for which i need to show Up/Down like given in the below snapshow, qa1 & qa3 are Up, qa2 is Down.

 ![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/c/d/cd1817bb6dff0535de0b12be879142971db898ff.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [March 12, 2018, 5:06pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/8 "2018-03-12T17:06:51Z")

</div>

@sahadevgd Kibana's Visualizations are based off of "aggregates" of values, and they generally don't represent individual documents in Elasticsearch. Can you share a screenshot of your full Visualization configuration?

---

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 13, 2018, 1:39pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/9 "2018-03-13T13:39:59Z")

</div>

Hi @Brandon_Kobel, Sorry for the delay in getting back to you. I have a couple of queries, could you please clarify. I'll provide you my data which I'm feeding via logstash.

Data:

ETime,OverAllStatus,Env,Host,Port,DiskSpaceStatus,ScriptStatus,DBStatus,TotalDiskSpace,FreeDiskSpace  
2018-03-12 10:20:24.516Z,1,qa1,[abc.xyz.com](http://abc.xyz.com),8080,1,1,1,315683848,178826512  
2018-03-12 10:20:49.123Z,1,qa2,[abc.xyz.com](http://abc.xyz.com),8080,1,1,1,315683848,178826222

So as you can see OverAllStatus,DiskSpaceStatus,ScriptStatus,DBStatus are getting data as 1's or 0's based on the Up/Down status.

How can I display this data as Up and Down or say Green or Red based on 1 and 0. Which visualization type should be used to have a better picture of this type of data.

If i have to convert this type of data to text, how can text be used to display. I am attaching a sample format.

![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/8/e/8e37845db444e1f3a4e0262732c1c5b058b4fcc9.png)

Instead of Log API, Log Transformer etc, i would be having QA1, QA2 etc.  
Please help.

---

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 19, 2018, 2:07pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/10 "2018-03-19T14:07:25Z")

</div>

Hi @Brandon_Kobel, Scripted Field worked for us.  
Thanks much.

---

<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:** [April 16, 2018, 2:07pm UTC](https://discuss.elastic.co/t/how-to-visualize-1-as-yes-and-0-as-no/123535/11 "2018-04-16T14:07:43Z")

</div>

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