<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: rename boolean value in a pie chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554565#M157401</link>
    <description>&lt;P&gt;Something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval boolean_field = if(boolean_field == "true", "true meaning", "false meaning")&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 05 Jun 2021 03:58:57 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2021-06-05T03:58:57Z</dc:date>
    <item>
      <title>rename boolean value in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554561#M157400</link>
      <description>&lt;P&gt;I have a boolean field which I get from the search, now when I do a stats count by boolean_field, the pie chart will show boolean_field=true and boolean_field=false.&lt;BR /&gt;&lt;BR /&gt;How do I rename these values to something custom/more meaningful?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 23:24:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554561#M157400</guid>
      <dc:creator>thenormalone</dc:creator>
      <dc:date>2021-06-04T23:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: rename boolean value in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554565#M157401</link>
      <description>&lt;P&gt;Something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval boolean_field = if(boolean_field == "true", "true meaning", "false meaning")&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 05 Jun 2021 03:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554565#M157401</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-06-05T03:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: rename boolean value in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554603#M157413</link>
      <description>&lt;P&gt;apologies but I should've mentioned that I tried that. After that if I do a stats command on it, the pie chart only shows one of the values&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2021 16:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554603#M157413</guid>
      <dc:creator>thenormalone</dc:creator>
      <dc:date>2021-06-06T16:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: rename boolean value in a pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554734#M157453</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/195013"&gt;@thenormalone&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;apologies but I should've mentioned that I tried that. After that if I do a stats command on it, the pie chart only shows one of the values&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is how you can illustrate your data &amp;nbsp;and output in a sanitized fashion:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your search&amp;gt;
| top 20 # limit output for illustration
| rename &amp;lt;your boolean field name&amp;gt; as boolean_field # rename to generic name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(because &amp;nbsp;the field has only two generic values, no sanitization needed.) &amp;nbsp;After this, you can use the generic field name to illustrate how the two pie charts differ. (Make sure to illustrate your generic test &amp;nbsp;code.&lt;/P&gt;&lt;P&gt;On my side, I generate a generic data set with the following simulator&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=50 # this part simulates data
| eval boolean_field = if((random() % 5 == 0 OR random() % 3 ==0), "false", "true")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data look like this&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;boolean_field&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;true&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;2021-06-07 09:34:58&lt;/TD&gt;&lt;TD width="45.21875px"&gt;false&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px"&gt;...&lt;/TD&gt;&lt;TD width="45.21875px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;As expected, a simple piechart will show true and false&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="simplepie.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14514i2C7DBC84789F3B43/image-size/large?v=v2&amp;amp;px=999" role="button" title="simplepie.png" alt="simplepie.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But if I rename my values using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval boolean_field = if(boolean_field == "true", "foo", "bar")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the piechart shows two values, foo and bar, not a &amp;nbsp;single value. (Unless the input data happen to contain only one of true or &amp;nbsp;false.)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="renamedpie.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14515iA87854BBE1DB2998/image-size/large?v=v2&amp;amp;px=999" role="button" title="renamedpie.png" alt="renamedpie.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;This &amp;nbsp;can be corroborated by examining the &amp;nbsp;"Statistics" &amp;nbsp;tab under the search box.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;boolean_field&lt;/TD&gt;&lt;TD&gt;count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="40px"&gt;bar&lt;/TD&gt;&lt;TD width="40px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="40px"&gt;foo&lt;/TD&gt;&lt;TD width="40px"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 07 Jun 2021 16:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-boolean-value-in-a-pie-chart/m-p/554734#M157453</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-06-07T16:51:00Z</dc:date>
    </item>
  </channel>
</rss>

