<?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 How to optimize the search with join command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504112#M140856</link>
    <description>&lt;P&gt;Hi, I have a query where I need to join it by a lookup to match the records. This is horribly slow and could be because of join command as it is very expensive.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to optimize this search as I have to run this for last 90 days and it keeps running for ages.&lt;/P&gt;
&lt;P&gt;My lookup only consist of one column i.e. URL against which I need to match the records and then count them&lt;/P&gt;
&lt;P&gt;Let me know if someone can advice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=myapp_pp sourcetype=access_combined GET host="my-server-*"
| join requested_conten
    [| inputlookup vanity.csv 
    | rename url as requested_content] 
| stats count by requested_content
| sort - count&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jun 2020 21:42:48 GMT</pubDate>
    <dc:creator>shashank_24</dc:creator>
    <dc:date>2020-06-15T21:42:48Z</dc:date>
    <item>
      <title>How to optimize the search with join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504112#M140856</link>
      <description>&lt;P&gt;Hi, I have a query where I need to join it by a lookup to match the records. This is horribly slow and could be because of join command as it is very expensive.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to optimize this search as I have to run this for last 90 days and it keeps running for ages.&lt;/P&gt;
&lt;P&gt;My lookup only consist of one column i.e. URL against which I need to match the records and then count them&lt;/P&gt;
&lt;P&gt;Let me know if someone can advice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=myapp_pp sourcetype=access_combined GET host="my-server-*"
| join requested_conten
    [| inputlookup vanity.csv 
    | rename url as requested_content] 
| stats count by requested_content
| sort - count&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 21:42:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504112#M140856</guid>
      <dc:creator>shashank_24</dc:creator>
      <dc:date>2020-06-15T21:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimise the search with Join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504123#M140857</link>
      <description>&lt;P&gt;Assuming you're joining on&amp;nbsp;&lt;STRONG&gt;requested_conten&lt;/STRONG&gt; and not&amp;nbsp;&lt;STRONG&gt;requested_content&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;something along the lines of&amp;nbsp;&lt;STRONG&gt;lookup vanity.csv&amp;nbsp;requested_conten OUTPUT url as requested_content&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;if the question contains a typo then you can easily modify the lookup command to fit your needs. Check out the documentation for lookup here:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/lookup" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/lookup&lt;/A&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 11:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504123#M140857</guid>
      <dc:creator>twesty</dc:creator>
      <dc:date>2020-06-12T11:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimise the search with Join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504127#M140858</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=myapp_pp sourcetype=access_combined GET host="my-server-*" [|inputlookup vanity.csv | rename url as requested_content |fields requested_content]
| stats values(requested_content) as requested_content&lt;/LI-CODE&gt;&lt;P&gt;You don't need &lt;STRONG&gt;join ,&amp;nbsp;&lt;/STRONG&gt;I guess.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 11:34:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504127#M140858</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-06-12T11:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimise the search with Join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504379#M140859</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;&amp;nbsp;that's right. It worked without join command.&lt;/P&gt;&lt;P&gt;Also is there a way to list out the unmatched url's from csv. I mean I want to run a search against those URL's in the CSV (around 900) for last 90 days and just list out the one's which are not present in the search/events.&lt;/P&gt;&lt;P&gt;Let me know if you can advice please.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 09:17:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504379#M140859</guid>
      <dc:creator>shashank_24</dc:creator>
      <dc:date>2020-06-15T09:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimise the search with Join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504393#M140860</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myapp_pp sourcetype=access_combined GET host="my-server-*" NOT [|inputlookup vanity.csv | rename url as requested_content |fields requested_content]
| stats values(requested_content) as requested_content&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try &lt;STRONG&gt;NOT &lt;/STRONG&gt;for unmatched searching.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 10:36:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504393#M140860</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-06-15T10:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimise the search with Join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504428#M140861</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;&amp;nbsp;Thanks for your quick response but this search will give all the results from my search.&lt;/P&gt;&lt;P&gt;So what I am looking for this is -&lt;/P&gt;&lt;P&gt;probably a table something like this - My lookup contains one column with around 800 requested_content and I want to find if any of those present in my search. If yes then "yes" and if not then "no".&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;requested_content&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;present&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="24px"&gt;/checkout&lt;/TD&gt;&lt;TD height="24px"&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;/your-details&lt;/TD&gt;&lt;TD&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;/billing&lt;/TD&gt;&lt;TD&gt;no&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I only want to list out the requested_content from the csv whether it's matched or not. I don't want to print anything else from the main query.&lt;/P&gt;&lt;P&gt;Hope I am able to explain. Let me know if it requires another question.&lt;/P&gt;&lt;P&gt;I have tried something like this but it doesn't work -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myapp_pp sourcetype=access_combined GET host="my-server-*"
| eval type="MainIndex" 
| fields requested_content type
| appendpipe  
    [| inputlookup vanity.csv  
    | eval type="lookup" 
    | rename vanity_url as requested_content 
    | fields type requested_content ] 
| stats dc(type) as pot, values(*) AS * by requested_content
| where pot=1 and type="lookup"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 15 Jun 2020 13:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504428#M140861</guid>
      <dc:creator>shashank_24</dc:creator>
      <dc:date>2020-06-15T13:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimise the search with Join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504497#M140862</link>
      <description>&lt;P&gt;I see your problem. but your problem is another question.&amp;nbsp;Please ask a separate question.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 21:01:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-optimize-the-search-with-join-command/m-p/504497#M140862</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-06-15T21:01:42Z</dc:date>
    </item>
  </channel>
</rss>

