<?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: return command is not giving desired result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650733#M224994</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252275"&gt;@AL3Z&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you already tried an easier solution?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt; NOT [ | inputlookup instances.csv | fields instance_id ]&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 05:48:21 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-07-17T05:48:21Z</dc:date>
    <item>
      <title>Why is return command not giving desired result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650727#M224992</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to exclude list of sites from my search from lookup table its not working as expected,&lt;/P&gt;
&lt;P&gt;base search&lt;/P&gt;
&lt;P&gt;sub search&lt;/P&gt;
&lt;P&gt;NOT&lt;/P&gt;
&lt;P&gt;(&lt;BR /&gt;[| inputlookup instances.csv&lt;BR /&gt;| fields instance_id&lt;BR /&gt;| return 1000 instance_id])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If we use same below as a sub search in my main search it is not giving any events what could be the reason ? do we need to modify sub search ?&lt;/P&gt;
&lt;P&gt;| inputlookup instances.csv | fields instance_id | return 1000 instance_id&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output:&lt;/P&gt;
&lt;P&gt;instance_id search&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="46.2396px" height="90px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="727.76px" height="90px"&gt;(instance_id="xyz") OR (instance_id="abc.com") OR (instance_id="cpl.com") OR (instance_id="ipl.com") OR (instance_id="bcci.com") OR (instance_id="pca.com") OR (instance_id="eca.com") OR (instance_id="aca.com") OR (instance_id="nca.com") OR (instance_id="ica.com") OR (instance_id="bca.com")&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 18 Jul 2023 00:49:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650727#M224992</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-18T00:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650733#M224994</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252275"&gt;@AL3Z&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you already tried an easier solution?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt; NOT [ | inputlookup instances.csv | fields instance_id ]&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 05:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650733#M224994</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-17T05:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650777#M225006</link>
      <description>&lt;P&gt;It is not working...&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 09:14:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650777#M225006</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-17T09:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650778#M225007</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252275"&gt;@AL3Z&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;are you sure that in the main search the field is exactly named "instance_id"?&lt;/P&gt;&lt;P&gt;if not, rename it in the subsearch&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 09:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650778#M225007</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-17T09:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650782#M225008</link>
      <description>&lt;P&gt;yes, no its working if I put&amp;nbsp; | return 1000 instance_id&lt;BR /&gt;&lt;BR /&gt;thanks...&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 09:23:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650782#M225008</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-17T09:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650787#M225009</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252275"&gt;@AL3Z&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I usually not use return in subsearches without issue, with the only attention to use the field name in main and sub searches!&lt;/P&gt;&lt;P&gt;what do you mean with "&lt;SPAN&gt;&amp;nbsp;no its working if I put&amp;nbsp; | return 1000 instance_id"? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;does it filter results or not? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;what's the difference using also returns?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What does it happen if you don't use NOT, have you results?&lt;/P&gt;&lt;P&gt;Usually the problem is the opposite: it runs without negation and runs with NOT.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 09:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650787#M225009</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-17T09:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650806#M225015</link>
      <description>&lt;P&gt;are you sure that in the main search the field is exactly named "instance_id"?&amp;nbsp; &amp;nbsp; &amp;nbsp; -----&amp;gt; yes&lt;/P&gt;&lt;P&gt;if not, rename it in the subsearch&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;---------------&amp;gt;&amp;nbsp; &amp;nbsp; No&lt;/P&gt;&lt;P&gt;If we use&amp;nbsp;&amp;lt;your_search&amp;gt;&amp;nbsp; [ | inputlookup instances.csv | fields instance_id ] its not filtering events.&lt;/P&gt;&lt;P&gt;Using [ | inputlookup instances.csv | fields instance_id | return 1000 instance_id]&amp;nbsp; its filtering all the events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;in my scenario we are using NOT to excludes these instances from my search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 11:08:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650806#M225015</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-17T11:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650808#M225016</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252275"&gt;@AL3Z&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I understood the you need the NOT condition, but it was only for debugging!&lt;/P&gt;&lt;P&gt;For my knowledge it should run without return, but with return have you the required filtering or not?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 11:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650808#M225016</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-17T11:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650824#M225022</link>
      <description>&lt;P&gt;&lt;SPAN&gt;yup,with return we do have&amp;nbsp; required filtering.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650824#M225022</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-17T13:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650828#M225024</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252275"&gt;@AL3Z&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;so what's the issue with the above search and subsearch?&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:20:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650828#M225024</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-17T13:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650975#M225070</link>
      <description>&lt;P&gt;In the sub search we need to use the return 1000 or not ?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 10:45:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650975#M225070</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-18T10:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: return command is not giving desired result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650987#M225076</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252275"&gt;@AL3Z&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I usually don't use it, but if, in you case, the search runs only with return, use it!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 12:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-return-command-not-giving-desired-result/m-p/650987#M225076</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-18T12:01:35Z</dc:date>
    </item>
  </channel>
</rss>

