<?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 find users that had only errors for certain event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348983#M103317</link>
    <description>&lt;P&gt;We have log entries in format like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LogLevel=info  username=some1 eventID=update
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So in case of error the LogLevel will be LogLevel=error &lt;BR /&gt;
LogLevel can also be debug&lt;/P&gt;

&lt;P&gt;What I need to do is to find all users that had &lt;CODE&gt;eventID=update but always had LogLevel=error&lt;/CODE&gt; and present them in table format &lt;BR /&gt;
&lt;CODE&gt;Username | count&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If I simply search &lt;BR /&gt;
&lt;CODE&gt;eventID=update LogLevel=error&lt;/CODE&gt; then I will get all matching entries for users with &lt;CODE&gt;LogLevel=error&lt;/CODE&gt; but some of these users probably also had entries with &lt;CODE&gt;LogLevel=info&lt;/CODE&gt; (or debug)&lt;BR /&gt;
How do I find users that had only LogLevel=error with this eventID?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 13:40:01 GMT</pubDate>
    <dc:creator>dsnytkine</dc:creator>
    <dc:date>2018-03-14T13:40:01Z</dc:date>
    <item>
      <title>How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348983#M103317</link>
      <description>&lt;P&gt;We have log entries in format like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LogLevel=info  username=some1 eventID=update
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So in case of error the LogLevel will be LogLevel=error &lt;BR /&gt;
LogLevel can also be debug&lt;/P&gt;

&lt;P&gt;What I need to do is to find all users that had &lt;CODE&gt;eventID=update but always had LogLevel=error&lt;/CODE&gt; and present them in table format &lt;BR /&gt;
&lt;CODE&gt;Username | count&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If I simply search &lt;BR /&gt;
&lt;CODE&gt;eventID=update LogLevel=error&lt;/CODE&gt; then I will get all matching entries for users with &lt;CODE&gt;LogLevel=error&lt;/CODE&gt; but some of these users probably also had entries with &lt;CODE&gt;LogLevel=info&lt;/CODE&gt; (or debug)&lt;BR /&gt;
How do I find users that had only LogLevel=error with this eventID?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 13:40:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348983#M103317</guid>
      <dc:creator>dsnytkine</dc:creator>
      <dc:date>2018-03-14T13:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348984#M103318</link>
      <description>&lt;P&gt;@dsnytkine, can you please try the following?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSeach&amp;gt; LogLevel="*" eventID="update"
| stats dc(LogLevel) as distinctCountLogLevel values(LogLevel) as LogLevels by username
| search distinctCountLogLevel=1 AND LogLevels="ERROR"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;values()&lt;/CODE&gt; statistical function gives unique values of &lt;CODE&gt;LogLevel&lt;/CODE&gt;. Similarly &lt;CODE&gt;dc()&lt;/CODE&gt; gives distinct count of LogLevel values. So only results filtered are those which have &lt;CODE&gt;only one unique LogLevel&lt;/CODE&gt; and that value is &lt;CODE&gt;ERROR&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 14:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348984#M103318</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-14T14:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348985#M103319</link>
      <description>&lt;P&gt;This gets you all the users with eventID="update" and only had log_level equals to error.&lt;/P&gt;

&lt;P&gt;index=yourindex eventID="update"&lt;BR /&gt;
    | stats sum(eval(if(log_level!="error",1,0))) as HadOtherLogLevels by user&lt;BR /&gt;
    | where HadOtherLogLevels==0&lt;/P&gt;

&lt;P&gt;Was this what you intended?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 14:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348985#M103319</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-14T14:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348986#M103320</link>
      <description>&lt;P&gt;Sounds like this is what I need. Is this the most efficient way? Thank you, I will test the solution.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 14:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348986#M103320</guid>
      <dc:creator>dsnytkine</dc:creator>
      <dc:date>2018-03-14T14:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348987#M103321</link>
      <description>&lt;P&gt;Yes, it worked, thank you. I'm wondering how common is this scenario?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 14:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348987#M103321</guid>
      <dc:creator>dsnytkine</dc:creator>
      <dc:date>2018-03-14T14:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348988#M103322</link>
      <description>&lt;P&gt;Great. Honestly never had seen that requirement, but it is under the normal logic of splunk things&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 14:56:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348988#M103322</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-14T14:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348989#M103323</link>
      <description>&lt;P&gt;Looks like it worked too, very interesting solution.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 16:56:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348989#M103323</guid>
      <dc:creator>dsnytkine</dc:creator>
      <dc:date>2018-03-14T16:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to find users that had only errors for certain event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348990#M103324</link>
      <description>&lt;P&gt;Splunk's &lt;CODE&gt;_internal&lt;/CODE&gt; logs also maintains log_level as "INFO", "ERROR","WARN" and "FATAL". So with a query like this you can search for the Splunk &lt;CODE&gt;component&lt;/CODE&gt; which has always thrown error. For example after &lt;CODE&gt;upgrade&lt;/CODE&gt;, &lt;CODE&gt;install&lt;/CODE&gt; or &lt;CODE&gt;config&lt;/CODE&gt; change etc. to isolate the issue. There could be several different use cases on similar lines.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 17:33:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-users-that-had-only-errors-for-certain-event/m-p/348990#M103324</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-14T17:33:10Z</dc:date>
    </item>
  </channel>
</rss>

