<?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: Nested Search and Map Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613590#M213253</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249580"&gt;@chteh&lt;/a&gt;&amp;nbsp;, nice to hear your issue resolved.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2022 11:34:34 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2022-09-19T11:34:34Z</dc:date>
    <item>
      <title>Nested Search and Map Search- Is there a way to make this search more efficient?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613535#M213234</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;I want to combine 2 search job into 1 job.&lt;BR /&gt;My first search job is to search all the alert_id occur in the past 24 hours and listed them as a table.&lt;/P&gt;
&lt;P&gt;2nd search job is to find among all the alert_id in the first search job and try to match which alert_id has an event of packet filtered .&lt;/P&gt;
&lt;P&gt;I am able to generate a desired result by using the "map search"&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="security_device" sourcetype= security_log "abnormal Protocol" alert_id
| table alert_id
| map search="search index="security_device" sourcetype=security_log "Filter action"  $alert_id$" maxsearches=500
| table filter-discard&lt;/LI-CODE&gt;
&lt;P&gt;However, I notice that using a map search is very in-efficient. It is taking forever if I select for 30 days. Can anyone recommend me a better way to do it.&amp;nbsp;&lt;BR /&gt;FYI, I have tried the nested search, but no luck, it return a 0 result to me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; index="security_device" sourcetype=security_log "Filter action"
              [ search index="security_device" sourcetype=security_log "abnormal Protocol" alert_id
              | table alert_id ]
| table filter-discard&lt;/LI-CODE&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2022 23:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613535#M213234</guid>
      <dc:creator>chteh</dc:creator>
      <dc:date>2022-09-18T23:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search and Map Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613536#M213235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249580"&gt;@chteh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you try search without subsearch. I assumed your "Filter action" and &lt;SPAN&gt;"abnormal Protocol"&amp;nbsp;&lt;/SPAN&gt;are in filter-discard field.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="security_device" sourcetype=security_log ("Filter action" OR "abnormal Protocol"
| stats values(filter-discard) as filter-discard by alert_id 
| where isnotnull(mvfind('filter-discard',"Filter action"))
| table filter-discard&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2022 19:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613536#M213235</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2022-09-18T19:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search and Map Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613545#M213239</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-09-19 at 11.42.41.png" style="width: 200px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21528i9EA7D1D63814D66C/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screenshot 2022-09-19 at 11.42.41.png" alt="Screenshot 2022-09-19 at 11.42.41.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;, thanks for your reply. Your idea is good but still I can't make a good output from what you have suggested. But you suggestion definitely giving me a new idea on this search. Now I am uploading a picture of my work (table alert_id filter-discard)&lt;/P&gt;&lt;P&gt;What i am trying to do is based on the alert_id field, if the ID exist in the filter-discard field, that meaning my router has taken an action for that particular alert_id.&amp;nbsp;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 03:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613545#M213239</guid>
      <dc:creator>chteh</dc:creator>
      <dc:date>2022-09-19T03:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search and Map Search- Is there a way to make this search more efficient?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613547#M213241</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249580"&gt;@chteh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Based on your picture, you can try below search;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; eval check=coalesce('filter-discard',alert_id) 
| stats values(*) as * by check 
| where NOT alert_id='filter-discard' AND isnotnull(alert_id) 
| fields - check&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Sep 2022 04:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613547#M213241</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2022-09-19T04:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search and Map Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613562#M213244</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;I managed to use the nested search to improve my delay in search, and now my search job did not take forever when I go for 30 days search duration:&lt;/P&gt;&lt;PRE&gt;index="security_device" sourcetype=security_log "Filter action" &lt;BR /&gt;     [ index="security_device" sourcetype=security_log "abnormal Protocol" alert_id &lt;BR /&gt;     | dedup alert_id &lt;BR /&gt;     | stats count by alert_id &lt;BR /&gt;     | rename alert_id as query &lt;BR /&gt;     | fields query &lt;BR /&gt;     | format] &lt;BR /&gt;| rex "Alert\s(?&amp;lt;ext_filter-discard&amp;gt;[0-9]{7})" &lt;BR /&gt;| dedup ext_filter-discard &lt;BR /&gt;| table ext_filter-discard &lt;BR /&gt;| stats count&lt;/PRE&gt;&lt;P&gt;The reason for using the dedup in alert_id and filter-discard is because each event it will have a "start" and "end" event, so what I just need 1 of them.&amp;nbsp;&lt;BR /&gt;So, the inner search will provide me all the alert_id in the log and the outer search will help me to find and match which of the alert_id actually associate with an action, which is filter-discard.&lt;/P&gt;&lt;P&gt;Here is the result of my inner search:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;( ( 4686463 ) OR ( 4686624 ) OR ( 4686638 ) OR ( 4686656 ) OR ( 4686679 ) OR ( 4686698 ) OR ( 4686744 ) OR ( 4686783 ) OR ( 4686802 ) OR ( 4686825 ) OR ( 4686853 ) OR ( 4686881 ) OR ( 4686902 ) OR ( 4686927 ) OR ( 4686963 ) OR ( 4686996 ) OR ( 4687020 ) OR ( 4687088 ) OR ( 4687118 ) OR ( 4687359 ) OR ( 4687386 ) OR ( 4687409 ) OR ( 4687697 ) OR ( 4687746 ) OR ( 4687775 ) OR ( 4687801 ) OR ( 4687825 ) OR ( 4687855 ) OR ( 4687877 ) OR ( 4687896 ) )&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Thanks again for your help&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 07:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613562#M213244</guid>
      <dc:creator>chteh</dc:creator>
      <dc:date>2022-09-19T07:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Search and Map Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613590#M213253</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249580"&gt;@chteh&lt;/a&gt;&amp;nbsp;, nice to hear your issue resolved.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 11:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-Search-and-Map-Search-Is-there-a-way-to-make-this-search/m-p/613590#M213253</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2022-09-19T11:34:34Z</dc:date>
    </item>
  </channel>
</rss>

