<?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: Work around if sub-search does not return data for a where clause. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/362234#M107004</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;[ search earliest=-24h@h latest=now index="si_errors" sourcetype="si_LateEnd" | dedup ClientID
| append [| makeresults | eval ClientID = "NobodyReallyButThereHasToBeSomebody"] 
| table ClientID   ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Aug 2017 22:05:12 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-08-10T22:05:12Z</dc:date>
    <item>
      <title>Work around if sub-search does not return data for a where clause.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/362233#M107003</link>
      <description>&lt;P&gt;Search: &lt;BR /&gt;
source=&lt;EM&gt;D:\XSP\importhelper&lt;/EM&gt; source=&lt;EM&gt;IH_Daily\DebugImportHelper&lt;/EM&gt; End&lt;BR /&gt;
| eval dayBuffer=strftime(now(), "%d") | eval day=ltrim(tostring(dayBuffer),"0") &lt;BR /&gt;
| eval todayBuffer=strftime(now(), "%m_"+day+"_%Y") | eval today=ltrim(tostring(todayBuffer),"0") | where like(source,"%".today."%")&lt;BR /&gt;
| rex field=source "importhelpers\+(?ClientID[^\]+)"&lt;BR /&gt;
| where (ClientID="WHI") OR (ClientID="IRM")&lt;BR /&gt;
| where NOT [ search earliest=-24h@h latest=now index="si_errors" sourcetype="si_LateEnd" | dedup ClientID | table ClientID ] | table ClientID, ...data for each ClientID returned, etc.&lt;/P&gt;

&lt;P&gt;IF I have results in the sub-search for the "where NOT" clause to compare against then I have no problems and it takes out the ClientIDs I do not want to see. However, if the sub-search is empty (the log files being monitored on sourcetype="si_LateEnd" have not been changed in the last 24 hours) then I get the error:&lt;BR /&gt;
"Error in 'where' command: The 'not' function is unsupported or undefined"&lt;/P&gt;

&lt;P&gt;In this case, based on the above search, I would want to return data for ClientIDs "WHI" and "IRM", rather than get an error. What possible work around is there for this error in my case?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/362233#M107003</guid>
      <dc:creator>griffinpair</dc:creator>
      <dc:date>2020-09-29T15:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Work around if sub-search does not return data for a where clause.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/362234#M107004</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;[ search earliest=-24h@h latest=now index="si_errors" sourcetype="si_LateEnd" | dedup ClientID
| append [| makeresults | eval ClientID = "NobodyReallyButThereHasToBeSomebody"] 
| table ClientID   ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Aug 2017 22:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/362234#M107004</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-10T22:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Work around if sub-search does not return data for a where clause.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/362235#M107005</link>
      <description>&lt;P&gt;This works perfect! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 13:48:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/362235#M107005</guid>
      <dc:creator>griffinpair</dc:creator>
      <dc:date>2017-08-11T13:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Work around if sub-search does not return data for a where clause.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/541388#M153278</link>
      <description>&lt;P&gt;Big big kudos buddy for the solution!!!&lt;/P&gt;&lt;P&gt;I tried all kind of tricks to get around the void list for the subsearch - related to a NOT operator, and finally got this one from you.&lt;/P&gt;&lt;P&gt;I find some things in the Splunk SPL pretty dumb, just to put it on the polite side!&lt;/P&gt;&lt;P&gt;Thanks a lot again.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 17:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Work-around-if-sub-search-does-not-return-data-for-a-where/m-p/541388#M153278</guid>
      <dc:creator>mhergh</dc:creator>
      <dc:date>2021-02-25T17:36:29Z</dc:date>
    </item>
  </channel>
</rss>

