<?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: Real time search, how to check if event doesn't exist and return something if it doesn't. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149956#M41989</link>
    <description>&lt;P&gt;No Problem, glad it helped, as a matter of fact I was just reading that thread! &lt;/P&gt;

&lt;P&gt;It works on a similar concept, if it can't find it then you could set the msg field where it says IfNotPresent.  &lt;/P&gt;

&lt;P&gt;Alternatively you could set IfPresent to "Complete" or "Not Completed" and table it, which would then produce a similar result.&lt;/P&gt;

&lt;P&gt;All in all, a good result &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2015 14:09:21 GMT</pubDate>
    <dc:creator>markthompson</dc:creator>
    <dc:date>2015-02-24T14:09:21Z</dc:date>
    <item>
      <title>Real time search, how to check if event doesn't exist and return something if it doesn't.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149953#M41986</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have some logs arriving into splunk every 5 minutes from a script running on an application server. The final line of logs indicates whether the script is complete or not. and looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;END :DATA COLLECTED ON 24 February 2015 at 14:41:23
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to check with real time if this line is there or not and if it isn't I would like to return a specific value indicating that the line is not there.&lt;/P&gt;

&lt;P&gt;Is this possible via an Eval command ? &lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 13:47:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149953#M41986</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2015-02-24T13:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Real time search, how to check if event doesn't exist and return something if it doesn't.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149954#M41987</link>
      <description>&lt;P&gt;This is easy enough.&lt;/P&gt;

&lt;P&gt;If you use an eval if statement with a regex that uses match, in the form of :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval IsPresent=if(match(_raw,"REGEX"), IfPresent, IfNotPresent)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should work for you, but you'll need to put a regex in.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 13:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149954#M41987</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T13:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Real time search, how to check if event doesn't exist and return something if it doesn't.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149955#M41988</link>
      <description>&lt;P&gt;Thank you Mark! &lt;/P&gt;

&lt;P&gt;This works in some cases but if there is no results displayed in the search the eval does not add an extra field. I found the answer on how to solve it here :&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/50379/table-message-when-no-results-found.html"&gt;http://answers.splunk.com/answers/50379/table-message-when-no-results-found.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:04:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149955#M41988</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2015-02-24T14:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Real time search, how to check if event doesn't exist and return something if it doesn't.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149956#M41989</link>
      <description>&lt;P&gt;No Problem, glad it helped, as a matter of fact I was just reading that thread! &lt;/P&gt;

&lt;P&gt;It works on a similar concept, if it can't find it then you could set the msg field where it says IfNotPresent.  &lt;/P&gt;

&lt;P&gt;Alternatively you could set IfPresent to "Complete" or "Not Completed" and table it, which would then produce a similar result.&lt;/P&gt;

&lt;P&gt;All in all, a good result &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:09:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-search-how-to-check-if-event-doesn-t-exist-and-return/m-p/149956#M41989</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T14:09:21Z</dc:date>
    </item>
  </channel>
</rss>

