<?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 Nested Search Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528574#M149260</link>
    <description>&lt;P&gt;OK I have been reading most of the morning and I have to just be missing something very simple.&lt;/P&gt;&lt;P&gt;To explain what I am trying to do.&lt;/P&gt;&lt;P&gt;1. Lets take the simple query index=* host=*test*|dedup host|table host&lt;/P&gt;&lt;P&gt;This will obviously give me a unique list of hosts.&lt;/P&gt;&lt;P&gt;2. Second Query index=* host=*test* "Bleebles"|dedup host|table host&lt;/P&gt;&lt;P&gt;This query will give me a unique list of hosts where the string "Bleebles" was found. (Obviously this is just example data)&lt;/P&gt;&lt;P&gt;What I am trying (And failing) at is marrying these two queries up, and returning ONLY hostnames that DO NOT return records with the string "Bleebles" but of course issue #1 is when I invert the logic on search #2 I get EVERY record that has been splunked and doesn't match (Which is literally all the data)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help with the logic I am missing here, using the two very basic queries above how would I first generate the full host list (That's the easy part) but then print a deduped list of hostnames that did NOT return a result in query #2, thereby giving me an exceptions list?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 18:01:44 GMT</pubDate>
    <dc:creator>mmccaugh9472</dc:creator>
    <dc:date>2020-11-09T18:01:44Z</dc:date>
    <item>
      <title>Nested Search Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528574#M149260</link>
      <description>&lt;P&gt;OK I have been reading most of the morning and I have to just be missing something very simple.&lt;/P&gt;&lt;P&gt;To explain what I am trying to do.&lt;/P&gt;&lt;P&gt;1. Lets take the simple query index=* host=*test*|dedup host|table host&lt;/P&gt;&lt;P&gt;This will obviously give me a unique list of hosts.&lt;/P&gt;&lt;P&gt;2. Second Query index=* host=*test* "Bleebles"|dedup host|table host&lt;/P&gt;&lt;P&gt;This query will give me a unique list of hosts where the string "Bleebles" was found. (Obviously this is just example data)&lt;/P&gt;&lt;P&gt;What I am trying (And failing) at is marrying these two queries up, and returning ONLY hostnames that DO NOT return records with the string "Bleebles" but of course issue #1 is when I invert the logic on search #2 I get EVERY record that has been splunked and doesn't match (Which is literally all the data)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help with the logic I am missing here, using the two very basic queries above how would I first generate the full host list (That's the easy part) but then print a deduped list of hostnames that did NOT return a result in query #2, thereby giving me an exceptions list?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 18:01:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528574#M149260</guid>
      <dc:creator>mmccaugh9472</dc:creator>
      <dc:date>2020-11-09T18:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528587#M149263</link>
      <description>&lt;P&gt;OK I think I may have finally figured this out, posting what I did in case anyone else comes across this down the line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=* host=*test* | join type=outer host [ search index=* host=*test* "Bleebles" | stats count by host ] | where isnull(count) | dedup host | table host | sort by host&lt;/P&gt;&lt;P&gt;This appears to be working so far!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 18:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528587#M149263</guid>
      <dc:creator>mmccaugh9472</dc:creator>
      <dc:date>2020-11-09T18:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528675#M149264</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=* host=*test* | where not match(_raw,"Bleebles")|dedup host|table host&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Nov 2020 19:21:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528675#M149264</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-09T19:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528732#M149270</link>
      <description>&lt;P&gt;This one still gives me the entire list (Not just the exceptions) but what I wrote does work, I just need to figure out why it takes so long to run and what I can do to improve it.&lt;/P&gt;&lt;P&gt;But at least it is accurate which is a start!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 20:12:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528732#M149270</guid>
      <dc:creator>mmccaugh9472</dc:creator>
      <dc:date>2020-11-09T20:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528737#M149275</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* host=*test* | eval hasString=if(match(_raw,"Bleebles"),1,0) | stats max(hasString) as hasString by host | where hasString=0 |table host&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Nov 2020 20:33:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-Question/m-p/528737#M149275</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-11-09T20:33:37Z</dc:date>
    </item>
  </channel>
</rss>

