<?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: Stats for unique users encountering an error by all users in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173100#M49641</link>
    <description>&lt;P&gt;In other words I have a query that currently looks like this and works&lt;BR /&gt;
search here &lt;BR /&gt;
| stats dc(ipAddress) AS impact  by Page error&lt;BR /&gt;
| xyseries error,Page ,impact &lt;BR /&gt;
| fillnull value=0 &lt;/P&gt;

&lt;P&gt;The psuedo code of what I want is&lt;BR /&gt;
search here&lt;BR /&gt;
| stats dc(ipAddressErrors)."/".dc(totalIpAddresses)  AS impact by Page error&lt;BR /&gt;
| xyseries error,Page ,impact &lt;BR /&gt;
| fillnull value=0 &lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2015 17:00:58 GMT</pubDate>
    <dc:creator>Cuyose</dc:creator>
    <dc:date>2015-05-06T17:00:58Z</dc:date>
    <item>
      <title>Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173097#M49638</link>
      <description>&lt;P&gt;Example:&lt;BR /&gt;
Return the count of users/ total users, encountering error by page, error&lt;/P&gt;

&lt;P&gt;So the X axis would be the rows for each distinct error, and the Y axis would be the page, and the data in each intersecting cell would be unique users encountering error on page/unique total users hitting page&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 16:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173097#M49638</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2015-05-06T16:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173098#M49639</link>
      <description>&lt;P&gt;If you have fields userId, page and error, it would look like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search terms&amp;gt; | chart dc(userId) over error by page limit=100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The limit=100 is because by default the chart command will display 9 split by values and then roll all the rest up into a big one called "OTHER".   limit=100 raises that threshold from 10 to 100. &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 16:43:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173098#M49639</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-05-06T16:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173099#M49640</link>
      <description>&lt;P&gt;This only gives a unique count of the users getting the error per page, what I need is the "errorUsers - totalUsers" per page&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 16:49:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173099#M49640</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2015-05-06T16:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173100#M49641</link>
      <description>&lt;P&gt;In other words I have a query that currently looks like this and works&lt;BR /&gt;
search here &lt;BR /&gt;
| stats dc(ipAddress) AS impact  by Page error&lt;BR /&gt;
| xyseries error,Page ,impact &lt;BR /&gt;
| fillnull value=0 &lt;/P&gt;

&lt;P&gt;The psuedo code of what I want is&lt;BR /&gt;
search here&lt;BR /&gt;
| stats dc(ipAddressErrors)."/".dc(totalIpAddresses)  AS impact by Page error&lt;BR /&gt;
| xyseries error,Page ,impact &lt;BR /&gt;
| fillnull value=0 &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 17:00:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173100#M49641</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2015-05-06T17:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173101#M49642</link>
      <description>&lt;P&gt;Understood.    You need rows of error,  columns of pages, and each cell to say "9/2131" meaning that 9 users experienced that error on that particular page, and 2131 total users experienced that error across all pages.&lt;/P&gt;

&lt;P&gt;Then what you need will look like this. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(ipAddress) as addresses dc(ipAddress) as impact by error Page
| streamstats dc(addresses) as totalUsersImpacted by error
| fields - addresses
| eval impact=impact + "/" + totalUsersImpacted
| xyseries error Page impact
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You need to do dc once in the regular stats command and then a second time with streamstats ... by error.   This streamstats clause will do the same dc math but only per error.   To give the streamstats the raw materials we need, we need to pass along the values(ipAddress) although after streamstats we can safely discard them. &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 18:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173101#M49642</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-05-06T18:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173102#M49643</link>
      <description>&lt;P&gt;close, but this part&lt;BR /&gt;
"Understood. You need rows of error, columns of pages, and each cell to say "9/2131" meaning that 9 users experienced that error on that particular page, and 2131 total users experienced that error across all pages."&lt;/P&gt;

&lt;P&gt;should read&lt;BR /&gt;
"Understood. You need rows of error, columns of pages, and each cell to say "9/2131" meaning that 9 users experienced that error on that particular page, and 2131 total users &lt;STRONG&gt;visited that page&lt;/STRONG&gt;."&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 19:13:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173102#M49643</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2015-05-06T19:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173103#M49644</link>
      <description>&lt;P&gt;Ah,  easy enough. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(ipAddress) as addresses dc(ipAddress) as impact by error Page
| streamstats dc(addresses) as totalUsersImpacted by Page
| fields - addresses
| eval impact=impact + "/" + totalUsersImpacted
| xyseries error Page impact
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'll post it as a separate answer since this one began pretty far away from what you needed. &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 23:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173103#M49644</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-05-06T23:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173104#M49645</link>
      <description>&lt;P&gt;New answer! &lt;/P&gt;

&lt;P&gt;OK. You need rows of error, columns of pages, and each cell to say "X/Y",  for example "9/2131" where it says that 9 users experienced that error on that particular page, and 2131 total users visited that page.&lt;/P&gt;

&lt;P&gt;Here you go: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(ipAddress) as addresses dc(ipAddress) as impact by error Page
 | streamstats dc(addresses) as totalUsersImpacted by Page
 | fields - addresses
 | eval impact=impact + "/" + totalUsersImpacted
 | xyseries error Page impact
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You need to do dc once in the regular stats command and then a second time with streamstats ... by error. This streamstats clause will do the same dc math but only per Error. To give the streamstats the raw materials we need, we need to pass along the values(ipAddress) although after streamstats we can safely discard them. &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 23:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173104#M49645</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-05-06T23:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173105#M49646</link>
      <description>&lt;P&gt;Hmm, this still is not doing what I would like, When searching back 60 minutes, it will report data like this&lt;BR /&gt;
               Logon      Search&lt;BR /&gt;
404        1/35             2/23&lt;/P&gt;

&lt;P&gt;The problem is, the value for the 1 and 2 seems correct, but the second number is way off, if I do a &lt;BR /&gt;
....page=logon&lt;BR /&gt;
|top 0 ipAddress&lt;/P&gt;

&lt;P&gt;I get say 157, so I would expect it to show 1/157 for that value.&lt;/P&gt;

&lt;P&gt;Where there were 157 unique ipAddress values for logon that did or did not receive the error, and 1 that did during the search time frame.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 23:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173105#M49646</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2015-05-06T23:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173106#M49647</link>
      <description>&lt;P&gt;Sounds like either Page or error is undefined for a lot of your requests.    I assumed you didn't want to count such events.&lt;BR /&gt;&lt;BR /&gt;
My first stats command there will implicitly discard rows that don't have a value for either error or Page.   If you want to include counts for things that don't have error or Page values,  then add before the first stats,  &lt;CODE&gt;| fillnull error Page value="NULL"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 23:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173106#M49647</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-05-06T23:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Stats for unique users encountering an error by all users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173107#M49648</link>
      <description>&lt;P&gt;I see what my issue here is based on your good explanation.  My issue is, the field that I am regex the error out of the event doesn't exist at all in the non-error events, so filling null, effectively doesn't do anything.  I need to figure out a way to include the total count.  I have another field that is common between both events, error and non-error.  LogLevel=INFO or LogLevel=ERROR. So I need to figure out a way to get the total unique non-error+error users now.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 14:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-for-unique-users-encountering-an-error-by-all-users/m-p/173107#M49648</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2015-05-07T14:46:57Z</dc:date>
    </item>
  </channel>
</rss>

