<?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: Negative Event searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132120#M184570</link>
    <description>&lt;P&gt;If I understand correctly, here's what you looking for.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=applicationlogs tag=serverset | 
eval status=if(match(eventcode, 12345), "yes", "no") | 
search status=no |
stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Jan 2014 19:30:20 GMT</pubDate>
    <dc:creator>theeven</dc:creator>
    <dc:date>2014-01-30T19:30:20Z</dc:date>
    <item>
      <title>Negative Event searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132119#M184569</link>
      <description>&lt;P&gt;How would you search an application log for the absence of one or more specific events in a given time period?&lt;/P&gt;

&lt;P&gt;I'm looking through event logs on multiple servers for specific records and am generating a report from them. So if an event of 12345 transpires, it's diplayed by this &lt;BR /&gt;
sourcetype=applicationlogs tag=serverset eventcode=12345 | stats count by host&lt;/P&gt;

&lt;P&gt;if it doesn't then that particular server just isn't listed in the report output. I'd like to note the absence and state "didn't happen".&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2014 19:11:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132119#M184569</guid>
      <dc:creator>jsmith39</dc:creator>
      <dc:date>2014-01-30T19:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Event searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132120#M184570</link>
      <description>&lt;P&gt;If I understand correctly, here's what you looking for.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=applicationlogs tag=serverset | 
eval status=if(match(eventcode, 12345), "yes", "no") | 
search status=no |
stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jan 2014 19:30:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132120#M184570</guid>
      <dc:creator>theeven</dc:creator>
      <dc:date>2014-01-30T19:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Event searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132121#M184571</link>
      <description>&lt;P&gt;Here's a thought (untested):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts index=yourindex | fields host | join type=left host [search index=yourindex blah blah eventcode=12345 | stats count by host] | fillnull count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Rows with count=0 are the droids you're looking for.&lt;/P&gt;

&lt;P&gt;Note, I'm assuming all hosts in that index are potential senders of eventcode=12345. If that's not the case then you need to compute a list of all relevant hosts there instead of using metadata.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2014 20:41:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132121#M184571</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-30T20:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Event searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132122#M184572</link>
      <description>&lt;P&gt;theeven: I had to modify what you wrote to get it to run&lt;BR /&gt;
tag=Backup| eval status=if(matcheventcode==34112, "yes", "no") | search status=no | stats count by host&lt;/P&gt;

&lt;P&gt;Perhaps I modified it too much, but the end result is that I'm getting the book thrown at me as every record that isn't the matched eventcode is returned.&lt;/P&gt;

&lt;P&gt;martin_mueller: Same scenario, I had to modify your query in order to run it, and perhaps I went too far but the results were not as expected. Strangely enough, there wasn't any statistics view and the records found were filtered, but I'm still trying to figure out in what way. The results are less than everything except 34112 but more than just noting an absence, for example I'm getting eventcode=0 and eventcode=58061 among other results.&lt;/P&gt;

&lt;P&gt;tag=Backup | fields host | join type=left host [search tag=Backup eventcode=34112  | stats count by host] | fillnull count&lt;/P&gt;

&lt;P&gt;Appreciate your help regardless&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2014 16:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132122#M184572</guid>
      <dc:creator>jsmith39</dc:creator>
      <dc:date>2014-01-31T16:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Event searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132123#M184573</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=applicationlogs tag=serverset 
| eval eventcode=if(match(eventcode, 34112), eventcode, "----") 
| stats count,values(eventcode) as eventcode  by host 
| eval isPresent=mvfind(eventcodes,"34112")
| eval count=if(isnull(isPresent),"Didn't happen", count)
| fields - isPresent, eventcode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2014 16:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132123#M184573</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-01-31T16:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Event searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132124#M184574</link>
      <description>&lt;P&gt;Replacing the call to &lt;CODE&gt;metadata&lt;/CODE&gt; with a search for some events does indeed change my search significantly, so that cannot work.You could replace &lt;CODE&gt;metadata&lt;/CODE&gt; with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search for all events | dedup host | fields host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What didn't work for you?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2014 18:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132124#M184574</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-31T18:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Event searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132125#M184575</link>
      <description>&lt;P&gt;Thanks for the input everyone, I ended up going a more brute force method that seems to be working.&lt;BR /&gt;
I tagged all of the servers to be searched, then filtered them by SourceName so I only had a working pool of logs that were related to the software application I'm looking at. It's a bit more verbose than I wanted but I'm hoping as I get more data I'll be able to refine it.&lt;/P&gt;

&lt;P&gt;tag=Backup SourceName="Backup Exec" | eval Outcome=case(EventCode==57755 OR EventCode==34112, "Success", EventCode==34113 OR EventCode==34114, "Failure", NOT EventCode==57755 OR EventCode==34112 OR EventCode==34113 OR EventCode==34114, "Missed Jobs") | stats count by host, Outcome | rename host as "Server Name"&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2014 18:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Negative-Event-searches/m-p/132125#M184575</guid>
      <dc:creator>jsmith39</dc:creator>
      <dc:date>2014-02-03T18:05:55Z</dc:date>
    </item>
  </channel>
</rss>

