<?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 optimize this search ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-this-search/m-p/600223#M208953</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243242"&gt;@Woodpecker&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first, the index condition is wrong, you should have&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=a OR index=b)&lt;/LI-CODE&gt;&lt;P&gt;Then, if your lookups don't change frequently and the number of IPs in lookups are less than 50,000, you could schedule a search that creates one lookup to use in the search, deduping the values and reducing in this way the occurrences to check.&lt;/P&gt;&lt;P&gt;Then you could use a KV-Store for your lookup to have better performaces.&lt;/P&gt;&lt;P&gt;Then the last dedup isn't mandatory.&lt;/P&gt;&lt;P&gt;In general your search isn't bad, but, if you have too many events in indexes "a" and "b", you could use a summary index in which you could store only the src_ips to test from your indexes, in this way you'll surely have a much more performant search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 06:45:52 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-06-02T06:45:52Z</dc:date>
    <item>
      <title>How to optimize this search ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-this-search/m-p/600217#M208950</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have an SPL, which should exclude the ip values from 4 lookups. So i tried it with a subsearch approach. But this search takes a longer time than usual to run.&amp;nbsp; How can I optimize it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=a OR b action=* attack!=N/A NOT ((
    [| inputlookup a.csv
    | fields ip 
    | rename ip as srcip]) OR ( 
    [| inputlookup b.csv
    | fields ip 
    | rename ip as src_ip]) OR ( 
    [| inputlookup c.csv
    | fields ip 
    | rename ip as src_ip]) OR ( 
    [| inputlookup d.csv
    | fields ip 
    | rename ip as src_ip]))  
| stats dc(attack) as dc_attack by src_ip
| where dc_attack &amp;gt;2
| dedup src_ip&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 05:41:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-this-search/m-p/600217#M208950</guid>
      <dc:creator>Woodpecker</dc:creator>
      <dc:date>2022-06-02T05:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize this search ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-this-search/m-p/600223#M208953</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243242"&gt;@Woodpecker&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first, the index condition is wrong, you should have&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=a OR index=b)&lt;/LI-CODE&gt;&lt;P&gt;Then, if your lookups don't change frequently and the number of IPs in lookups are less than 50,000, you could schedule a search that creates one lookup to use in the search, deduping the values and reducing in this way the occurrences to check.&lt;/P&gt;&lt;P&gt;Then you could use a KV-Store for your lookup to have better performaces.&lt;/P&gt;&lt;P&gt;Then the last dedup isn't mandatory.&lt;/P&gt;&lt;P&gt;In general your search isn't bad, but, if you have too many events in indexes "a" and "b", you could use a summary index in which you could store only the src_ips to test from your indexes, in this way you'll surely have a much more performant search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 06:45:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-this-search/m-p/600223#M208953</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-06-02T06:45:52Z</dc:date>
    </item>
  </channel>
</rss>

