<?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 edit my search to calculate failure percentage through Splunk logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275113#M82992</link>
    <description>&lt;P&gt;I have logs like:&lt;BR /&gt;
"The request failed"&lt;BR /&gt;
"The request succeeded"&lt;BR /&gt;
"The request failed"&lt;BR /&gt;
"The request failed"&lt;BR /&gt;
"The request succeeded"&lt;/P&gt;

&lt;P&gt;I want to calculate failure % every day  on the basis of the string ("failed" or "succeeded")&lt;/P&gt;

&lt;P&gt;please help me correct this search (marked in ***): &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...base search... | timechart span=1d ***eval((count("failed"))/((count("failed"))+(count ("succeeded"))))*** as failureRate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Oct 2016 19:52:07 GMT</pubDate>
    <dc:creator>eleena1994</dc:creator>
    <dc:date>2016-10-27T19:52:07Z</dc:date>
    <item>
      <title>How to edit my search to calculate failure percentage through Splunk logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275113#M82992</link>
      <description>&lt;P&gt;I have logs like:&lt;BR /&gt;
"The request failed"&lt;BR /&gt;
"The request succeeded"&lt;BR /&gt;
"The request failed"&lt;BR /&gt;
"The request failed"&lt;BR /&gt;
"The request succeeded"&lt;/P&gt;

&lt;P&gt;I want to calculate failure % every day  on the basis of the string ("failed" or "succeeded")&lt;/P&gt;

&lt;P&gt;please help me correct this search (marked in ***): &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...base search... | timechart span=1d ***eval((count("failed"))/((count("failed"))+(count ("succeeded"))))*** as failureRate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 19:52:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275113#M82992</guid>
      <dc:creator>eleena1994</dc:creator>
      <dc:date>2016-10-27T19:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate failure percentage through Splunk logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275114#M82993</link>
      <description>&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| timechart span=1d count("failed") as failed count("succeeded") as succeeded|eval failureRate=failed/(failed+succeeded)|fields - failed - succeeded
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you might need to add something like &lt;CODE&gt;count(match(x,"failed"))&lt;/CODE&gt; into the &lt;CODE&gt;timechart&lt;/CODE&gt; command instead of the &lt;CODE&gt;count("failed")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:21:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275114#M82993</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-27T20:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate failure percentage through Splunk logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275115#M82994</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "The request (?&amp;lt;status&amp;gt;\w+)" | timechart span=1d count by status | eval "%failed"=round(failed*100/(failed+succeeded),1) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:28:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275115#M82994</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-27T20:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate failure percentage through Splunk logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275116#M82995</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "The request (?&amp;lt;status&amp;gt;\w+)" 
| timechart span=1d count(eval(status="failed")) as failed,  count(eval(status="succeeded")) as success
| eval failureRate=(failed/(failed+success))*100
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Oct 2016 03:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275116#M82995</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-10-28T03:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate failure percentage through Splunk logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275117#M82996</link>
      <description>&lt;P&gt;Hi @eleena1994 - Looks like you have a few answers to choose from &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Did any one of the answers below help resolve your question? If yes, please don't forget to resolve your post by clicking "Accept" below the best answer. If no, please leave a comment with some feedback. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 01:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-failure-percentage-through/m-p/275117#M82996</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2016-11-08T01:44:02Z</dc:date>
    </item>
  </channel>
</rss>

