<?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: ForEach value in table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595344#M207200</link>
    <description>&lt;P&gt;In general, your remark is of course correct and hundred percent valid. But in this case I suppose it doesn't make much of a difference since the subsearch results have to be returned to the search-head initiating the search so it can compose the main search with the subsearch results to have a full search for dispatching to search peers.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2022 06:43:59 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2022-04-26T06:43:59Z</dc:date>
    <item>
      <title>How to search ForEach value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595323#M207189</link>
      <description>&lt;P&gt;I would like to search for each value in an extracted field.&lt;/P&gt;
&lt;P&gt;My intial query is as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=moneta-pro "IPN Post API  execution started for the orderRefNo" AND "printOs" | rex field=_raw "(?ms)^(?:[^ \\n]* ){9}(?P&amp;lt;orderId&amp;gt;\\d+)" offset_field=_extracted_fields_boundsd_fields_bounds | table orderId | dedup orderId&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which returns following:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="orderId.PNG" style="width: 469px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19316i692B00B15774CB80/image-size/large?v=v2&amp;amp;px=999" role="button" title="orderId.PNG" alt="orderId.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now I'd like to use each value in OrderId and use it in search and append to the above table. For example, check the status of the order. Individual query should look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=* " Received response status code as 200 and the message body as" AND orderId=&amp;lt;&amp;lt;each dynamic value from above table&amp;gt;&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 17:54:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595323#M207189</guid>
      <dc:creator>dipendrapokhare</dc:creator>
      <dc:date>2022-04-26T17:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: ForEach value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595328#M207192</link>
      <description>&lt;P&gt;Make the first search a subsearch to the second, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* " Received response status code as 200 and the message body as" [ 
  search index=moneta-pro "IPN Post API  execution started for the orderRefNo" AND "printOs" 
  | rex field=_raw "(?ms)^(?:[^ \\n]* ){9}(?P&amp;lt;orderId&amp;gt;\\d+)" offset_field=_extracted_fields_boundsd_fields_bounds 
  | fields orderId
  | dedup orderId
]&lt;/LI-CODE&gt;&lt;P&gt;Note the use of fields, not table (fields is more efficient in that it can run on the indexer, whereas table will always run on the search head.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 05:42:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595328#M207192</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-26T05:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: ForEach value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595344#M207200</link>
      <description>&lt;P&gt;In general, your remark is of course correct and hundred percent valid. But in this case I suppose it doesn't make much of a difference since the subsearch results have to be returned to the search-head initiating the search so it can compose the main search with the subsearch results to have a full search for dispatching to search peers.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 06:43:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595344#M207200</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-26T06:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: ForEach value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595350#M207204</link>
      <description>&lt;P&gt;It makes a difference in that the original ordering was table + dedup, hence the duplicates would be sent to the SH before being deduped.&lt;/P&gt;&lt;P&gt;I don't know how splunk manages the distribution of multiple searches and whether it has to dispatch each search separately - I've never delved into that too deeply&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 07:01:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595350#M207204</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-26T07:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: ForEach value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595462#M207238</link>
      <description>&lt;P&gt;Here you are right. I rarely use dedup as such (I'm mostly a "stats values" kinda guy ;-)). You could change the order of commands (dedup | table) but then again fields | dedup is more elegant, I agree.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 17:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595462#M207238</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-26T17:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: ForEach value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595497#M207249</link>
      <description>&lt;P&gt;Agreed on dedup! It seems somewhat nondeterministic. Makes more sense to use stats&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 23:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-ForEach-value-in-table/m-p/595497#M207249</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-26T23:44:55Z</dc:date>
    </item>
  </channel>
</rss>

