<?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: How to calculate percentages for multi valued search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percentages-for-multi-valued-search/m-p/119171#M184024</link>
    <description>&lt;P&gt;Something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | stats count by host | eventstats avg(count) as avg | eval delta = ((count/avg-1)*100)."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 19 Jan 2014 21:17:28 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-01-19T21:17:28Z</dc:date>
    <item>
      <title>How to calculate percentages for multi valued search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percentages-for-multi-valued-search/m-p/119170#M184023</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I am getting requests by host (if we have 20 hosts) then i have 20 values. Now i want to calculate the percentage delta for each host with the average number of requests for all the host. So i got the average hosts for all the hosts and using stats i got the requests per each host. But now how do i calculate percentage delta for each host. Here is the query i have. &lt;BR /&gt;
i have eval RequestsPctDelta = ((RequestPerHost-AverageRequests)/AverageRequests)*100&lt;BR /&gt;
but i need somekind of for loop so that i get the RequestsPctDelta for each host? any suggestions would help a lot. Thank you. &lt;/P&gt;

&lt;P&gt;| stats count as requests | eval AverageRequests= requests/20  | stats count as RequestPerHost by host | eval RequestsPctDelta = ((RequestPerHost-AverageRequests)/AverageRequests)*100 | table RequestsPctDelta &lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2014 21:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percentages-for-multi-valued-search/m-p/119170#M184023</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2014-01-19T21:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percentages for multi valued search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percentages-for-multi-valued-search/m-p/119171#M184024</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | stats count by host | eventstats avg(count) as avg | eval delta = ((count/avg-1)*100)."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jan 2014 21:17:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percentages-for-multi-valued-search/m-p/119171#M184024</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-19T21:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percentages for multi valued search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percentages-for-multi-valued-search/m-p/119172#M184025</link>
      <description>&lt;P&gt;Thank you so much Marti. This is what i wanted.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2014 22:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percentages-for-multi-valued-search/m-p/119172#M184025</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2014-01-20T22:03:42Z</dc:date>
    </item>
  </channel>
</rss>

