<?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: SubSearch with different index and pass the fields to MainSearch and only use one filed from it for query purpose in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592993#M206404</link>
    <description>&lt;P&gt;Hey Mayur,&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to your suggestion I tried the query&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subsearch give me the output I need&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ComputerName	src	uri	date
pc44        	xx	/ui/n	apri/7/2022&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when combined with main search&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ComputerName |ownerEmail| ownerFull|ownerName|ownerDept| date| src | uri
4GV	        test@com   Jack	      nal        ghjsj    &amp;lt;N/A&amp;gt; &amp;lt;N/A&amp;gt; &amp;lt;N/A&amp;gt;	 	 	 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want use &lt;STRONG&gt;computername&lt;/STRONG&gt; from subsearch&amp;nbsp; to search in main search and also append the sub search filed data to main search&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2022 20:25:04 GMT</pubDate>
    <dc:creator>adeshreddy</dc:creator>
    <dc:date>2022-04-07T20:25:04Z</dc:date>
    <item>
      <title>SubSearch with different index and pass the fields to MainSearch and only use one filed from it for query purpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592970#M206387</link>
      <description>&lt;P&gt;Hey Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get my head around this query&amp;nbsp;&lt;/P&gt;&lt;P&gt;My subsearch below, The query will look for the api path,src and Ip's and I am doing dns lookup to get hostname which is present in different index&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;site = "friendly" index=traffic_log src="*"  uri="*" | eval date = date_month + "/" + date_mday + "/" + date_wday + "/" + date_year | mvexpand date | dedup src | dedup uri  | lookup dnslookup  clientip as src OUTPUT clienthost as ComputerName | where like (ComputerName,"p%") | 
dedup ComputerName |table ComputerName,src,uri,date&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main query. If see my main query Computername is the only filed which is present in main index search and want to use for searching with computername. which will give the owner details of the hostname but also I want the src,uri,date fileds from subsearch to be added in table&amp;nbsp;&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="wineventlog" source="WinEventLog:Application"  [ search site = "friendly.org" index=traffic_log src="*"  uri="*" | eval date = date_month + "/" + date_mday + "/" + date_wday + "/" + date_year | mvexpand date | dedup src | dedup uri  | lookup dnslookup  clientip as src OUTPUT clienthost as ComputerName | where like (ComputerName,"p%") | 
dedup ComputerName |fields ComputerName,src,uri,date] | dedup ComputerName| dedup ownerEmail | dedup ownerFull | dedup ownerName | dedup ownerDept | table ComputerName, ownerEmail,ownerFull,ownerName,ownerDept,src,uri,date&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone throw insights into the query&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 19:09:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592970#M206387</guid>
      <dc:creator>adeshreddy</dc:creator>
      <dc:date>2022-04-07T19:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch with different index and pass the fields to MainSearch and only use one filed from it for query purpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592983#M206394</link>
      <description>&lt;P&gt;Not sure if this is what you are looking for&lt;/P&gt;&lt;P&gt;below search will give you results from the main search as well as matching results from the subsearch:&lt;/P&gt;&lt;P&gt;if you are just interested in matching results then change &lt;STRONG&gt;type=inner&lt;/STRONG&gt;&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="wineventlog" source="WinEventLog:Application" 
| dedup ComputerName, ownerEmail, ownerFull, ownerName, ownerDept 
| stats values(ownerEmail) as ownerEmail,values(ownerFull) as ownerFull, values(ownerName) ownerName, values(ownerDept) as ownerDept by ComputerName 
| join type=left ComputerName 
    [ search index=traffic_log src="*" uri="*" site="friendly.org" 
    | eval date = date_month + "/" + date_mday + "/" + date_wday + "/" + date_year 
    | mvexpand date 
    | dedup src, uri 
    | lookup dnslookup clientip as src OUTPUT clienthost as ComputerName 
    | where like (ComputerName,"p%") 
    | dedup ComputerName 
    | stats values(src) as src, values(uri) as uri, values(date) as date by ComputerName]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 19:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592983#M206394</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2022-04-07T19:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch with different index and pass the fields to MainSearch and only use one filed from it for query purpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592993#M206404</link>
      <description>&lt;P&gt;Hey Mayur,&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to your suggestion I tried the query&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subsearch give me the output I need&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ComputerName	src	uri	date
pc44        	xx	/ui/n	apri/7/2022&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when combined with main search&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ComputerName |ownerEmail| ownerFull|ownerName|ownerDept| date| src | uri
4GV	        test@com   Jack	      nal        ghjsj    &amp;lt;N/A&amp;gt; &amp;lt;N/A&amp;gt; &amp;lt;N/A&amp;gt;	 	 	 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want use &lt;STRONG&gt;computername&lt;/STRONG&gt; from subsearch&amp;nbsp; to search in main search and also append the sub search filed data to main search&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 20:25:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592993#M206404</guid>
      <dc:creator>adeshreddy</dc:creator>
      <dc:date>2022-04-07T20:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch with different index and pass the fields to MainSearch and only use one filed from it for query purpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592996#M206406</link>
      <description>&lt;P&gt;Well thats what "&lt;STRONG&gt;type=left&lt;/STRONG&gt;" will do, it will give you results from the main search as well as the matching results from the subsearch.&lt;/P&gt;&lt;P&gt;The above example is not matching your computerName is different, for subsearch it's PC44 and for main search it's 4GV that's why you see date,src and uri field blank in the result. Look for the one's where computerName is matching and there you should see all the fields.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 20:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/592996#M206406</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2022-04-07T20:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: SubSearch with different index and pass the fields to MainSearch and only use one filed from it for query purpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/593011#M206412</link>
      <description>&lt;P&gt;Thanks Mayur,&lt;/P&gt;&lt;P&gt;The query helped.&lt;/P&gt;&lt;P&gt;What happen was subsearch computername was returning the value with lower case (pc4555)and main search computername value was returning uppercase (PC455).&lt;/P&gt;&lt;P&gt;Converted the main search value to lower case was able to find match the values.&lt;/P&gt;&lt;P&gt;Do you have any idea to omit the the data if field values are empty&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 21:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SubSearch-with-different-index-and-pass-the-fields-to-MainSearch/m-p/593011#M206412</guid>
      <dc:creator>adeshreddy</dc:creator>
      <dc:date>2022-04-07T21:18:33Z</dc:date>
    </item>
  </channel>
</rss>

