<?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: Percentage Timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Percentage-Timechart/m-p/30653#M6233</link>
    <description>&lt;P&gt;This should do something like what you want;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart span=1m c(eval(HasError=1)) AS err c AS tot | eval err_ratio_perc = round(err/tot*100,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the round() and multiplication by 100 are not necessary, but produces '16' instead of '0.16000' &lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2012 22:44:36 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2012-08-09T22:44:36Z</dc:date>
    <item>
      <title>Percentage Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-Timechart/m-p/30652#M6232</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am trying to plot the percentage of "total requests" vs "total errors" and am unfortunately in need of help.&lt;/P&gt;

&lt;P&gt;I struggled for a good day now, using lots of different methods to do this, im fairly new to Splunk so any help would be appreciated.&lt;/P&gt;

&lt;P&gt;Ok, simply.... my data can be searched using the below.&lt;/P&gt;

&lt;P&gt;sourcetype="tcsb_webintel" ServiceName="MCS (Middleware Communication Service)" (AvailableFaresRequestMessage OR GetScheduledAirAvailabilityRequestMessage)&lt;/P&gt;

&lt;P&gt;This will bring back all requests, all of which have HasError=0 or HasError=1 in the data to signify an error exists with that particular request.&lt;/P&gt;

&lt;P&gt;i,e if i just wanted all errors i could search for ...&lt;BR /&gt;
sourcetype="tcsb_webintel" ServiceName="MCS (Middleware Communication Service)" (AvailableFaresRequestMessage OR GetScheduledAirAvailabilityRequestMessage) HasError=1&lt;/P&gt;

&lt;P&gt;What i am after is to show the total requests on a timechart, along with the percentage those requests that had errors.&lt;/P&gt;

&lt;P&gt;I wont post what i have tried already as i have tried a few different ways, appending searches, using eval etc, none of which i could bend to my will. &lt;/P&gt;

&lt;P&gt;i would greatly appreciate any assistance or guidance in the correct way to approach this....&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Paul&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2012 15:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-Timechart/m-p/30652#M6232</guid>
      <dc:creator>paulf</dc:creator>
      <dc:date>2012-08-09T15:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-Timechart/m-p/30653#M6233</link>
      <description>&lt;P&gt;This should do something like what you want;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart span=1m c(eval(HasError=1)) AS err c AS tot | eval err_ratio_perc = round(err/tot*100,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the round() and multiplication by 100 are not necessary, but produces '16' instead of '0.16000' &lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2012 22:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-Timechart/m-p/30653#M6233</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-08-09T22:44:36Z</dc:date>
    </item>
  </channel>
</rss>

