<?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 Optimize Nested Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439963#M125134</link>
    <description>&lt;P&gt;This search is slow (our dns logs are large).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=winlogs sourcetype=dns | eval dottedquestion=replace(replace(questionname,"\(\d+\)","."),"\.(.*)\.","\1") | search [| inputlookup baddomains | return 10000 dottedquestion=Domain]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Outside of shrinking the time window (I am not interested in going under 24 hours) is there anyway to optimize it?  The baddomains list is very small (&amp;lt;1000)&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2019 01:22:05 GMT</pubDate>
    <dc:creator>antb</dc:creator>
    <dc:date>2019-08-08T01:22:05Z</dc:date>
    <item>
      <title>Optimize Nested Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439963#M125134</link>
      <description>&lt;P&gt;This search is slow (our dns logs are large).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=winlogs sourcetype=dns | eval dottedquestion=replace(replace(questionname,"\(\d+\)","."),"\.(.*)\.","\1") | search [| inputlookup baddomains | return 10000 dottedquestion=Domain]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Outside of shrinking the time window (I am not interested in going under 24 hours) is there anyway to optimize it?  The baddomains list is very small (&amp;lt;1000)&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 01:22:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439963#M125134</guid>
      <dc:creator>antb</dc:creator>
      <dc:date>2019-08-08T01:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize Nested Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439964#M125135</link>
      <description>&lt;P&gt;Can you share some sample pattern for &lt;EM&gt;questionname&lt;/EM&gt; field?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 06:43:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439964#M125135</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-08-08T06:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize Nested Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439965#M125136</link>
      <description>&lt;P&gt;Sure - apparently ms logs dns in “pascal style” string format.  Showing the length of each next section in parens ending in (0).&lt;/P&gt;

&lt;P&gt;(12)somecomputer(6)domain(3)com(0)&lt;/P&gt;

&lt;P&gt;Defined in 4.1.2 of the RFC1035:&lt;BR /&gt;
&lt;A href="https://tools.ietf.org/html/rfc1035"&gt;https://tools.ietf.org/html/rfc1035&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 11:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439965#M125136</guid>
      <dc:creator>antb</dc:creator>
      <dc:date>2019-08-08T11:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize Nested Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439966#M125137</link>
      <description>&lt;P&gt;If you're not counting and just looking for presence, try a "dedup dottedquestion" just before the | search.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 12:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439966#M125137</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-08-08T12:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize Nested Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439967#M125138</link>
      <description>&lt;P&gt;Probably &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/Join"&gt;join&lt;/A&gt; might help you.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=winlogs sourcetype=dns 
| eval Domain=replace(replace(questionname,"\(\d+\)","."),"\.(.*)\.","\1") 
| join type=inner Domain 
    [| inputlookup baddomains 
    | table Domain]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, if it's ad-hoc search, Run in 'Fast Mode' instead of 'Verbose Mode'.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 05:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Optimize-Nested-Search/m-p/439967#M125138</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-08-09T05:12:18Z</dc:date>
    </item>
  </channel>
</rss>

