<?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 How to create pie charts with column values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615546#M213922</link>
    <description>&lt;P&gt;Hi guys, I am quite new to the Splunk world, pls forgive me for asking a very basic question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have a table as following:&lt;BR /&gt;&lt;BR /&gt;job_id &amp;nbsp; &amp;nbsp; total_passed &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;total_failed &amp;nbsp; &amp;nbsp; &amp;nbsp;total_not_run&lt;/P&gt;
&lt;P&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;31 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&lt;/P&gt;
&lt;P&gt;and so on. I want to create a pie chart for different job_ids (lets say 9), with&amp;nbsp;total_passed, total_failed, total_not_run values (14, 20, 6) and total_passed, total_failed, total_not_run as the headers of the chart in Splunk dashboard. how to do it? any help will be deeply appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 08:41:35 GMT</pubDate>
    <dc:creator>ktanwar</dc:creator>
    <dc:date>2022-10-03T08:41:35Z</dc:date>
    <item>
      <title>How to create pie charts with column values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615546#M213922</link>
      <description>&lt;P&gt;Hi guys, I am quite new to the Splunk world, pls forgive me for asking a very basic question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have a table as following:&lt;BR /&gt;&lt;BR /&gt;job_id &amp;nbsp; &amp;nbsp; total_passed &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;total_failed &amp;nbsp; &amp;nbsp; &amp;nbsp;total_not_run&lt;/P&gt;
&lt;P&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;31 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&lt;/P&gt;
&lt;P&gt;and so on. I want to create a pie chart for different job_ids (lets say 9), with&amp;nbsp;total_passed, total_failed, total_not_run values (14, 20, 6) and total_passed, total_failed, total_not_run as the headers of the chart in Splunk dashboard. how to do it? any help will be deeply appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 08:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615546#M213922</guid>
      <dc:creator>ktanwar</dc:creator>
      <dc:date>2022-10-03T08:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pie charts with column values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615563#M213927</link>
      <description>&lt;P&gt;So, if you're only looking to show a pie chart for a single job_id, then you could do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="job_id     total_passed        total_failed      total_not_run
9                14                           20                         6
10              25                            31                        9"
| multikv forceheader=1 

| table job_id total_passed total_failed total_not_run
| where job_id=9 
| transpose 0 header_field=job_id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The first part up to the '| table..' is creating your example.&lt;/P&gt;&lt;P&gt;The 'where' statement is just filtering only job_id 9&lt;/P&gt;&lt;P&gt;and the transpose statement converts columns to rows, so you will have 3 rows with the names/values and then the pie chart will look like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_0-1664762154372.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21818i4B2B425E65BBA89E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_0-1664762154372.png" alt="bowesmana_0-1664762154372.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;bowesmana_0-1664762154372.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 01:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615563#M213927</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-10-03T01:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pie charts with column values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615572#M213930</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;. Tried it, works like a charm!&lt;/P&gt;&lt;P&gt;1 follow up question on this, how can I change the colour of the pie chart sections and the name of the fields shown on the pie chart section (instead of total_passed, I would like to see Total Passed).&lt;/P&gt;&lt;P&gt;Thanks a lot mate for helping me out here!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 03:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615572#M213930</guid>
      <dc:creator>ktanwar</dc:creator>
      <dc:date>2022-10-03T03:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pie charts with column values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615736#M213969</link>
      <description>&lt;P&gt;Here's an example dashboard showing the rename and setting the colours.&lt;/P&gt;&lt;P&gt;In the XML you can see charting.fieldColors option to set the colours&lt;/P&gt;&lt;PRE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;tst1&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
| eval _raw="job_id     total_passed        total_failed      total_not_run
9                14                           20                         6
10              25                            31                        9"
| multikv forceheader=1 

| table job_id total_passed total_failed total_not_run
| where job_id=9 
| rename total_passed as "Total Passed" total_failed as "Total Failed" total_not_run as "Total not Run"
| transpose 0 header_field=job_id&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;pie&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.fieldColors"&amp;gt;
          {"Total Failed": 0xFF0000, "Total not Run": 0xFF9900, "Total Passed":0x009900, "NULL":0xC4C4C0}
        &amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 23:15:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615736#M213969</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-10-03T23:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create pie charts with column values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615763#M213978</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; !&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 05:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-pie-charts-with-column-values/m-p/615763#M213978</guid>
      <dc:creator>ktanwar</dc:creator>
      <dc:date>2022-10-04T05:38:02Z</dc:date>
    </item>
  </channel>
</rss>

