<?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 create report on failure rates using count of errors per session and total number of sessions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187013#M53875</link>
    <description>&lt;P&gt;We'd like to be able to report on failure rates within our application. The metric we will use is errors per session / total # of sessions.&lt;/P&gt;

&lt;P&gt;We can identify when a user logs in by searching for a particular search phrase (i.e. "user X logged in") and when an error occurs ("error X occurred while processing the request for user X").&lt;/P&gt;

&lt;P&gt;So, total # of sessions = number of log statements that contain the text "user X logged in"&lt;BR /&gt;
errors per session = number of log statements that contain the text "error X occurred while processing the request for user X"&lt;/P&gt;

&lt;P&gt;I know that I can get a count for each of the two statement types, but how do I feed that into a single report?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2014 16:33:06 GMT</pubDate>
    <dc:creator>sjnorman</dc:creator>
    <dc:date>2014-08-19T16:33:06Z</dc:date>
    <item>
      <title>How to create report on failure rates using count of errors per session and total number of sessions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187013#M53875</link>
      <description>&lt;P&gt;We'd like to be able to report on failure rates within our application. The metric we will use is errors per session / total # of sessions.&lt;/P&gt;

&lt;P&gt;We can identify when a user logs in by searching for a particular search phrase (i.e. "user X logged in") and when an error occurs ("error X occurred while processing the request for user X").&lt;/P&gt;

&lt;P&gt;So, total # of sessions = number of log statements that contain the text "user X logged in"&lt;BR /&gt;
errors per session = number of log statements that contain the text "error X occurred while processing the request for user X"&lt;/P&gt;

&lt;P&gt;I know that I can get a count for each of the two statement types, but how do I feed that into a single report?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2014 16:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187013#M53875</guid>
      <dc:creator>sjnorman</dc:creator>
      <dc:date>2014-08-19T16:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create report on failure rates using count of errors per session and total number of sessions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187014#M53876</link>
      <description>&lt;P&gt;Assuming that you have written regexes to extract both the texts and the field names that you have given are: UserLogin, Error&lt;/P&gt;

&lt;P&gt;Then you can write search like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Some search terms... | stats count(UserLogin) as TotalSessions, count(Error) as TotalErrors | eval FailureRate = TotalErrors/TotalSessions
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Aug 2014 17:39:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187014#M53876</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-19T17:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create report on failure rates using count of errors per session and total number of sessions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187015#M53877</link>
      <description>&lt;P&gt;Wouldn't the login and error statements be considered  event types, and within those types, fields would be things such as user ID, error type, etc.?&lt;/P&gt;

&lt;P&gt;i.e. &lt;BR /&gt;
user X logged in = Login event type&lt;BR /&gt;
X = user_id field&lt;/P&gt;

&lt;P&gt;Maybe I'm misunderstanding what Splunk considers a field?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 12:07:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187015#M53877</guid>
      <dc:creator>sjnorman</dc:creator>
      <dc:date>2014-08-20T12:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create report on failure rates using count of errors per session and total number of sessions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187016#M53878</link>
      <description>&lt;P&gt;I used your suggestion below but matched on raw search terms.&lt;/P&gt;

&lt;P&gt;stats count(eval(match(_raw,"&lt;STRONG&gt;login search terms&lt;/STRONG&gt;"))) as TotalSessions, count(eval(match(_raw,"&lt;STRONG&gt;&lt;EM&gt;error search terms&lt;/EM&gt;&lt;/STRONG&gt;"))) as TotalErrors | eval FailureRate = TotalErrors/TotalSessions&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-report-on-failure-rates-using-count-of-errors-per/m-p/187016#M53878</guid>
      <dc:creator>sjnorman</dc:creator>
      <dc:date>2020-09-28T17:22:16Z</dc:date>
    </item>
  </channel>
</rss>

