<?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: Declare a variable for a search to find distribution of calls in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120446#M32366</link>
    <description>&lt;P&gt;I tried the alternative approach and once again, calculatetax is working great but the others are showing 0. For the first query you posted, I'm getting less &lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2015 19:35:24 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2015-04-01T19:35:24Z</dc:date>
    <item>
      <title>Declare a variable for a search to find distribution of calls</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120441#M32361</link>
      <description>&lt;P&gt;I have 4 basic web services (I'll add more later) which are called throughout the day. My CalculateTax web service is called the most, followed by LookupTax which has the 2nd most, followed by DeliverySchedule has 3rd most, followed by ProductAvailability has the least. So I want to make a dashboard pie chart which shows the distribution of these calls. &lt;/P&gt;

&lt;P&gt;I tried extracting the fields for these calls but unfortunately I'm only getting 80% of the calls, I need 100% of them. So is there anyway which I could define each of the 4 searches as a variable then tie all the variables together and find the percent of each web service and put it in a pie chart?&lt;/P&gt;

&lt;P&gt;As of now I can do &lt;CODE&gt;... "CalculateTaxRequest" | stats count&lt;/CODE&gt;  and get a count of the results for CalculateTax but when trying to add another web service call onto that search it will not count or it will combine the count totals of both web services and I cannot get a distribution of each call. &lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 15:35:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120441#M32361</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-04-01T15:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a variable for a search to find distribution of calls</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120442#M32362</link>
      <description>&lt;P&gt;follow the logic shown in this query: &lt;/P&gt;

&lt;P&gt;search 1st | stats count as count1 | join [search 2nd|stats count as count2] | fields count1 count2 | transpose &lt;/P&gt;

&lt;P&gt;let me know if it works for you.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120442#M32362</guid>
      <dc:creator>tonykung</dc:creator>
      <dc:date>2015-04-01T16:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a variable for a search to find distribution of calls</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120443#M32363</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..."CalculateTaxRequest" OR "LookupTax" OR "DeliverySchedule" OR "ProductAvailability" | eval Service=case(match(_raw,"CalculateTaxRequest),"CalculateTaxRequest",match(_raw,"LookupTax"),"LookupTax", match(_raw,"DeliverySchedule"),"DeliverySchedule",1=1,"ProductAvailability") | stats count by Service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Alternative approach&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"CalculateTaxRequest"  | stats count | eval Service="CalculateTaxRequest" | append
[search "LookupTax"  | stats count | eval Service="LookupTax"] |append 
[search "DeliverySchedule"  | stats count | eval Service="DeliverySchedule" ] |append
[search "ProductAvailability"  | stats count | eval Service="ProductAvailability"] | table Service,count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120443#M32363</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-04-01T16:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a variable for a search to find distribution of calls</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120444#M32364</link>
      <description>&lt;P&gt;Thanks for the reply. I followed your example and it output exactly what I was looking for.. CalculateTax was perfect but the other 3 web services counts were off by a lot. Any idea as to why that would happen? &lt;/P&gt;

&lt;P&gt;DeliverySchedule = off by 231&lt;BR /&gt;
ProductAvailability = off by 406&lt;BR /&gt;
LookupTax = off by 296 &lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 18:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120444#M32364</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-04-01T18:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a variable for a search to find distribution of calls</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120445#M32365</link>
      <description>&lt;P&gt;My query assumes you have only one Web service name available in one event. So, you're getting lesser count OR more?&lt;/P&gt;

&lt;P&gt;Also, try the alternative approach if that helps.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 19:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120445#M32365</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-04-01T19:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a variable for a search to find distribution of calls</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120446#M32366</link>
      <description>&lt;P&gt;I tried the alternative approach and once again, calculatetax is working great but the others are showing 0. For the first query you posted, I'm getting less &lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 19:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Declare-a-variable-for-a-search-to-find-distribution-of-calls/m-p/120446#M32366</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-04-01T19:35:24Z</dc:date>
    </item>
  </channel>
</rss>

