<?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 use lookup in subsearch with join in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379322#M111152</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206066"&gt;@twh1&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;I would suggest you two ways here:&lt;BR /&gt;
1. Use automatic lookup based where for sourcetype="test:data"&lt;BR /&gt;
in input fields you can mention  PROC_CODE and if you want fields from lookup them you can use field value override option.&lt;BR /&gt;
By using that the fields will be automatically will be available in search &lt;BR /&gt;
like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="test_data" sourcetype="test:data"   | table TIMESTAMP SID SYS_NAME PROC_TYPE PROC_PARA PROC_CODE PROC_NAME PROC_VALUE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Other way is using lookup as suggested by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; in comments:&lt;BR /&gt;
like &lt;/P&gt;

&lt;P&gt;index="test_data" sourcetype="test:data" &lt;BR /&gt;
 | lookup PROC_CODE as PROC_CODE  OUTPUT PROC_CODE PROC_NAME PROC_PARA PROC_TYPE &lt;BR /&gt;
 | table TIMESTAMP SID SYS_NAME PROC_TYPE PROC_PARA PROC_CODE PROC_NAME PROC_VALUE&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:14:45 GMT</pubDate>
    <dc:creator>vishaltaneja070</dc:creator>
    <dc:date>2020-09-30T01:14:45Z</dc:date>
    <item>
      <title>How to use lookup in subsearch with join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379320#M111150</link>
      <description>&lt;P&gt;I have requirement to print product details in a table. where i am getting some value from the log and some i have print based on matching product code from lookup table. &lt;/P&gt;

&lt;P&gt;I tried below query and I am getting result in proper format.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup PROC_DETAIL | table PROC_CODE PROC_NAME PROC_PARA PROC_TYPE | join PROC_CODE [ search index="test_data" sourcetype="test:data" | table TIMESTAMP SID PROC_CODE PROC_VALUE SYS_NAME ] | fields TIMESTAMP SID SYS_NAME PROC_TYPE PROC_PARA PROC_CODE PROC_NAME PROC_VALUE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But when I am expanding time range to see more data, my result count is remaining same, as I am matching the value from lookup table. I want to main my log data as main search and for each event, i want value of &lt;STRONG&gt;PROC_NAME PROC_PARA PROC_TYPE&lt;/STRONG&gt; should come from lookup table based on matching &lt;STRONG&gt;PROC_CODE&lt;/STRONG&gt;. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379320#M111150</guid>
      <dc:creator>twh1</dc:creator>
      <dc:date>2020-09-30T01:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use lookup in subsearch with join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379321#M111151</link>
      <description>&lt;P&gt;Hi twh1,&lt;BR /&gt;
if you put a search in subsearch, you have the limit of 50,000 results, so expanding the time range you don't have additional results.&lt;BR /&gt;
Anyway, the lookup command is like a join command so, rebuild your search inverting the terms.&lt;BR /&gt;
In addition, you don't need to use the table command in intermediate part of the search.&lt;BR /&gt;
In other words, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="test_data" sourcetype="test:data" 
| lookup PROC_DETAIL PROC_CODE OUTPUT PROC_CODE PROC_NAME PROC_PARA PROC_TYPE 
| table TIMESTAMP SID SYS_NAME PROC_TYPE PROC_PARA PROC_CODE PROC_NAME PROC_VALUE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;beware that the key field PROC_CODE must be the same in search and lookup (and it's case sensitive), if it's different, add the option &lt;CODE&gt;PROC_CODE AS other_PROC_CODE&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:11:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379321#M111151</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T01:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use lookup in subsearch with join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379322#M111152</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206066"&gt;@twh1&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;I would suggest you two ways here:&lt;BR /&gt;
1. Use automatic lookup based where for sourcetype="test:data"&lt;BR /&gt;
in input fields you can mention  PROC_CODE and if you want fields from lookup them you can use field value override option.&lt;BR /&gt;
By using that the fields will be automatically will be available in search &lt;BR /&gt;
like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="test_data" sourcetype="test:data"   | table TIMESTAMP SID SYS_NAME PROC_TYPE PROC_PARA PROC_CODE PROC_NAME PROC_VALUE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Other way is using lookup as suggested by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; in comments:&lt;BR /&gt;
like &lt;/P&gt;

&lt;P&gt;index="test_data" sourcetype="test:data" &lt;BR /&gt;
 | lookup PROC_CODE as PROC_CODE  OUTPUT PROC_CODE PROC_NAME PROC_PARA PROC_TYPE &lt;BR /&gt;
 | table TIMESTAMP SID SYS_NAME PROC_TYPE PROC_PARA PROC_CODE PROC_NAME PROC_VALUE&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:14:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379322#M111152</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2020-09-30T01:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use lookup in subsearch with join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379323#M111153</link>
      <description>&lt;P&gt;Thanks @gcusello , it helped me alot. &lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 18:49:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379323#M111153</guid>
      <dc:creator>twh1</dc:creator>
      <dc:date>2019-07-05T18:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use lookup in subsearch with join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379324#M111154</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="test_data" sourcetype="test:data"
| lookup PROC_DETAIL PROC_CODE OUTPUT PROC_NAME PROC_PARA PROC_TYPE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 Jul 2019 00:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-lookup-in-subsearch-with-join/m-p/379324#M111154</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-06T00:03:07Z</dc:date>
    </item>
  </channel>
</rss>

