<?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 Need to create a search thatshows both success percentage and failure count in dual axis combo chart. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-create-a-search-thatshows-both-success-percentage-and/m-p/500772#M139428</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I need to write a search that shows both the success percentage and failure count in a dual axis combo chart. &lt;/P&gt;

&lt;P&gt;I am able to do it independently, but unable to do it in a combo chart, which is only showing the trend for the last 7 days (y-axis) while failure events will give the overall count for the day (x-axis). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"requestMethod=POST AND "/customerentitlementsservice/v1/ces/account*" responseStatus"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Success trend:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|dedup requestId 
|eval FailureCount=if((responseStatus != 200) OR like(Status,"%,%"),1,0) 
|bin _time span=1d 
|stats  count as Total, sum(FailureCount) as Fail by _time 
|eval successrate=Round(((Total-Fail)*100)/Total,2 )
|eval Date =strftime(_time, "%m/%d/%y") 
|chart values(successrate)  AS Successrate% by Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 May 2020 22:37:07 GMT</pubDate>
    <dc:creator>vijaysubramania</dc:creator>
    <dc:date>2020-05-18T22:37:07Z</dc:date>
    <item>
      <title>Need to create a search thatshows both success percentage and failure count in dual axis combo chart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-create-a-search-thatshows-both-success-percentage-and/m-p/500772#M139428</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I need to write a search that shows both the success percentage and failure count in a dual axis combo chart. &lt;/P&gt;

&lt;P&gt;I am able to do it independently, but unable to do it in a combo chart, which is only showing the trend for the last 7 days (y-axis) while failure events will give the overall count for the day (x-axis). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"requestMethod=POST AND "/customerentitlementsservice/v1/ces/account*" responseStatus"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Success trend:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|dedup requestId 
|eval FailureCount=if((responseStatus != 200) OR like(Status,"%,%"),1,0) 
|bin _time span=1d 
|stats  count as Total, sum(FailureCount) as Fail by _time 
|eval successrate=Round(((Total-Fail)*100)/Total,2 )
|eval Date =strftime(_time, "%m/%d/%y") 
|chart values(successrate)  AS Successrate% by Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 May 2020 22:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-create-a-search-thatshows-both-success-percentage-and/m-p/500772#M139428</guid>
      <dc:creator>vijaysubramania</dc:creator>
      <dc:date>2020-05-18T22:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create a search thatshows both success percentage and failure count in dual axis combo chart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-create-a-search-thatshows-both-success-percentage-and/m-p/500773#M139429</link>
      <description>&lt;P&gt;Use this below query which will give you the successrate along with sum(failcount) per day basis in a single chart. Please accept the answer once you resolve the issue. Thanks &lt;/P&gt;

&lt;P&gt;|dedup requestId &lt;BR /&gt;
|eval FailureCount=if((Status!=200) OR like(Status,"%,%"),1,0) &lt;BR /&gt;
 |bin _time span=1d &lt;BR /&gt;
 |stats  count as Total, sum(FailureCount) as Fail by _time&lt;BR /&gt;
 |eval successrate=Round(((Total-Fail)*100)/Total,2 )&lt;BR /&gt;
 |eval Date =strftime(_time, "%m/%d/%y") &lt;BR /&gt;
| stats values(Fail) as Fail , values(successrate) as successrate by _time&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-create-a-search-thatshows-both-success-percentage-and/m-p/500773#M139429</guid>
      <dc:creator>maityayan1996</dc:creator>
      <dc:date>2020-09-30T05:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create a search thatshows both success percentage and failure count in dual axis combo chart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-create-a-search-thatshows-both-success-percentage-and/m-p/500774#M139430</link>
      <description>&lt;P&gt;Thanks maityayan. This works,&lt;/P&gt;

&lt;P&gt;I did it in other way around but only problem is printing in 6 decimals&lt;/P&gt;

&lt;P&gt;|stats count(eval(responseStatus=200)) as Success, count as Total by _time &lt;BR /&gt;
|eval Percent=round((Success/Total)*100,2), Failure=Total-Success |eval Date =strftime(_time, "%m/%d/%y") &lt;BR /&gt;
|timechart avg(Percent)  AS Successrate%, avg(Failure) AS Failed-Session-Count&lt;/P&gt;

&lt;P&gt;94.680000   617.000000&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:29:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-create-a-search-thatshows-both-success-percentage-and/m-p/500774#M139430</guid>
      <dc:creator>vijaysubramania</dc:creator>
      <dc:date>2020-09-30T05:29:05Z</dc:date>
    </item>
  </channel>
</rss>

