<?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 use two different fields to create a pie chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168810#M48142</link>
    <description>&lt;P&gt;Hi Splukers,&lt;/P&gt;

&lt;P&gt;My problem here is that i have a search :&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=myindexname sourcetype=mysourcetype |stats latest(field1) as postedpayments latest(field2) as exceptions |eval result=round(expected-actual) &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;What i want to do is that i want to show in the pie chart the value of &lt;STRONG&gt;posted payments&lt;/STRONG&gt; and the value of the &lt;STRONG&gt;exceptions&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Please help us with our problem&lt;/P&gt;

&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Oct 2014 08:30:15 GMT</pubDate>
    <dc:creator>shariinPH</dc:creator>
    <dc:date>2014-10-16T08:30:15Z</dc:date>
    <item>
      <title>How to use two different fields to create a pie chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168810#M48142</link>
      <description>&lt;P&gt;Hi Splukers,&lt;/P&gt;

&lt;P&gt;My problem here is that i have a search :&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=myindexname sourcetype=mysourcetype |stats latest(field1) as postedpayments latest(field2) as exceptions |eval result=round(expected-actual) &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;What i want to do is that i want to show in the pie chart the value of &lt;STRONG&gt;posted payments&lt;/STRONG&gt; and the value of the &lt;STRONG&gt;exceptions&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Please help us with our problem&lt;/P&gt;

&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2014 08:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168810#M48142</guid>
      <dc:creator>shariinPH</dc:creator>
      <dc:date>2014-10-16T08:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use two different fields to create a pie chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168811#M48143</link>
      <description>&lt;P&gt;Hi shariinPH;&lt;/P&gt;

&lt;P&gt;from the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.4/Viz/Datastructurerequirementsforvisualizations#Pie_charts"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.4/Viz/Datastructurerequirementsforvisualizations#Pie_charts&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Pie charts are one dimensional and only support a single series. They work off of tables with just two columns, where the first column contains the labels for each slice of the pie, and the second column contains numerical values that correspond to each label, determining the relative size of each slice. If the table generated by the search contains additional columns, those extra columns have no meaning in the terms of the pie chart and are ignored.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;This means your search will not work this way. But there are some ways you can achieve the target; try this run everywhere command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal OR index=_audit | stats count(buckets) AS buckets sum(kb) AS sum | transpose
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal OR index=_audit | eval type=case(isnotnull(kb), "kb", isnotnull(buckets), "buckets") | stats count by type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;adapted to your provide search string, something like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindexname sourcetype=mysourcetype | stats latest(field1) as postedpayments latest(field2) as exceptions | transpose
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps to get you started ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2014 09:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168811#M48143</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-10-16T09:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use two different fields to create a pie chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168812#M48144</link>
      <description>&lt;P&gt;Thanks @Mus.  It works! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2014 09:56:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168812#M48144</guid>
      <dc:creator>shariinPH</dc:creator>
      <dc:date>2014-10-16T09:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use two different fields to create a pie chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168813#M48145</link>
      <description>&lt;P&gt;| transpose is what I needed&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2015 19:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-two-different-fields-to-create-a-pie-chart/m-p/168813#M48145</guid>
      <dc:creator>demodav</dc:creator>
      <dc:date>2015-12-03T19:37:30Z</dc:date>
    </item>
  </channel>
</rss>

