<?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 Help with a nested search not returning any data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480196#M134586</link>
    <description>&lt;P&gt;I am running a nested search but does not return any data.&lt;/P&gt;

&lt;P&gt;However, when I run the search separately it does.&lt;/P&gt;

&lt;P&gt;The full search with no results is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="f5-default" [search index="cisco_asa" host="192.168.5.x" dest_ip="172.16.5.57" 
| stats count by session_id src_ip | where count=2 | dedup src_ip | rename src_ip as IP | table IP]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But my first search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="cisco_asa" host="192.168.5.2" dest_ip="172.16.5.57" src_ip!="208.94.147.100" src_ip="40.77.167.108"

| stats count by session_id src_ip | where count=2 | dedup src_ip | rename src_ip as IP | table IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="f5-default" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get events.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2019 18:52:46 GMT</pubDate>
    <dc:creator>lamelendrez</dc:creator>
    <dc:date>2019-11-08T18:52:46Z</dc:date>
    <item>
      <title>Help with a nested search not returning any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480196#M134586</link>
      <description>&lt;P&gt;I am running a nested search but does not return any data.&lt;/P&gt;

&lt;P&gt;However, when I run the search separately it does.&lt;/P&gt;

&lt;P&gt;The full search with no results is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="f5-default" [search index="cisco_asa" host="192.168.5.x" dest_ip="172.16.5.57" 
| stats count by session_id src_ip | where count=2 | dedup src_ip | rename src_ip as IP | table IP]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But my first search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="cisco_asa" host="192.168.5.2" dest_ip="172.16.5.57" src_ip!="208.94.147.100" src_ip="40.77.167.108"

| stats count by session_id src_ip | where count=2 | dedup src_ip | rename src_ip as IP | table IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="f5-default" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get events.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 18:52:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480196#M134586</guid>
      <dc:creator>lamelendrez</dc:creator>
      <dc:date>2019-11-08T18:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a nested search not returning any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480197#M134587</link>
      <description>&lt;P&gt;Subsearches become literal text in their main searches.  If the subsearch results in 3 IP addresses like &lt;CODE&gt;10.2.3.4, 10.3.4.5, 10.4.5.6&lt;/CODE&gt; then the full search will be &lt;CODE&gt;index="f5-default 10.2.3.4 10.3.4.5 10.4.5.6&lt;/CODE&gt; which means all three IP addresses have to be present in an event to show up.  Try this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="f5-default" [search index="cisco_asa" host="192.168.5.x" dest_ip="172.16.5.57"
| stats count by session_id src_ip | where count=2 | dedup src_ip | rename src_ip as IP | fields IP | format]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;format&lt;/CODE&gt; command adds &lt;CODE&gt;OR&lt;/CODE&gt; operators between the results so you get a final search that looks like &lt;CODE&gt;index="f5-default (IP=10.2.3.4 OR IP=10.3.4.5 OR IP=10.4.5.6)&lt;/CODE&gt;, which should work better.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 19:54:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480197#M134587</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-11-08T19:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a nested search not returning any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480198#M134588</link>
      <description>&lt;P&gt;Does the index f5-default have a field named IP?&lt;/P&gt;

&lt;P&gt;You could try getting your subsearch to return a plain text filter like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="f5-default" [search index="cisco_asa" host="192.168.5.x" dest_ip="172.16.5.57"
  | stats count by session_id src_ip 
  | where count=2 
  | dedup src_ip 
  | fields src_ip
  | rename src_ip as search]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Documentation here - &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/Search/Changetheformatofsubsearchresults"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/Search/Changetheformatofsubsearchresults&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 19:13:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480198#M134588</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-09T19:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a nested search not returning any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480199#M134589</link>
      <description>&lt;P&gt;Your search assumes that the field with the IPAddress in &lt;CODE&gt;index="f5-default"&lt;/CODE&gt; is named &lt;CODE&gt;IP&lt;/CODE&gt; which evidently it is not (otherwise it would DEFINITELY work).  Fix the &lt;CODE&gt;| rename src_ip AS IP&lt;/CODE&gt; to the correct field name.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 23:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-nested-search-not-returning-any-data/m-p/480199#M134589</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-09T23:26:13Z</dc:date>
    </item>
  </channel>
</rss>

