<?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: How to format subsearch to give results with OR operator between and dropping field names. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-format-subsearch-to-give-results-with-OR-operator-between/m-p/371267#M174728</link>
    <description>&lt;P&gt;Hi ankithreddy777,&lt;/P&gt;

&lt;P&gt;Have you tried below search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 [search index=index2 earliest=10d | dedup productId | return 10000 $productId]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here I have used return command. For more info please check below URL.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.3/SearchReference/Return"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.3/SearchReference/Return&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have used 10000 as head parameter to limit product Ids.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Kamlesh&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 11:46:56 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2017-05-10T11:46:56Z</dc:date>
    <item>
      <title>How to format subsearch to give results with OR operator between and dropping field names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-format-subsearch-to-give-results-with-OR-operator-between/m-p/371265#M174726</link>
      <description>&lt;P&gt;I have a scenario where my subsearch should yield results in following format.&lt;BR /&gt;
       Index=index1 [search index=index2 earliest=10 days /table productId]&lt;/P&gt;

&lt;P&gt;My productid valies are&lt;BR /&gt;
ProductId= value1&lt;BR /&gt;
ProductId=value2 etc&lt;/P&gt;

&lt;P&gt;Should yeild&lt;BR /&gt;
     Index=index1 (value 1 ) OR (value2).....&lt;/P&gt;

&lt;P&gt;May I know what is tbe best approach.How can I just return values&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 10:35:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-format-subsearch-to-give-results-with-OR-operator-between/m-p/371265#M174726</guid>
      <dc:creator>ankithreddy777</dc:creator>
      <dc:date>2017-05-10T10:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to format subsearch to give results with OR operator between and dropping field names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-format-subsearch-to-give-results-with-OR-operator-between/m-p/371266#M174727</link>
      <description>&lt;P&gt;There are two ways: 1) let the subsearch simply return with a column of the &lt;CODE&gt;productid&lt;/CODE&gt; field, or 2) use the &lt;CODE&gt;format&lt;/CODE&gt; command to make the exact search string.&lt;/P&gt;

&lt;P&gt;The first option is generally better, but there are some situations where the second option is needed.&lt;/P&gt;

&lt;P&gt;First option: &lt;CODE&gt;index=index1 [search index=index2 earliest=-10d@d | stats count by  productId | fields + productid]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Second option: &lt;CODE&gt;index=index1 [search index=index2 earliest=-10d@d | stats count by  productId | fields productid | format]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 11:04:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-format-subsearch-to-give-results-with-OR-operator-between/m-p/371266#M174727</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-05-10T11:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to format subsearch to give results with OR operator between and dropping field names.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-format-subsearch-to-give-results-with-OR-operator-between/m-p/371267#M174728</link>
      <description>&lt;P&gt;Hi ankithreddy777,&lt;/P&gt;

&lt;P&gt;Have you tried below search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 [search index=index2 earliest=10d | dedup productId | return 10000 $productId]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here I have used return command. For more info please check below URL.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.3/SearchReference/Return"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.3/SearchReference/Return&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have used 10000 as head parameter to limit product Ids.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Kamlesh&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 11:46:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-format-subsearch-to-give-results-with-OR-operator-between/m-p/371267#M174728</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-05-10T11:46:56Z</dc:date>
    </item>
  </channel>
</rss>

