<?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 sub-search and then join with another search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409944#M118246</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;had facing issues in using join command , i have two search (sub-search, search)which needs to be joined together.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;sub search :&lt;/P&gt;

&lt;P&gt;"C:\Windows\System32\windows.exe" sourcetype=windows&lt;BR /&gt;
[search sourcetype=scanner &lt;BR /&gt;
| dedup FQDN &lt;BR /&gt;
| rename FQDN as ComputerName] &lt;BR /&gt;
|table Process ComputerName&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;search &lt;/P&gt;

&lt;P&gt;sourcetype=scanner&lt;BR /&gt;
| dedup FQDN&lt;BR /&gt;
|rename FQDN as ComputerName&lt;BR /&gt;
|convert ctime(_time) as time&lt;BR /&gt;
|stats earliest(time) as et latest(time) as lt by ComputerName IP status&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Join both sub-search and search using ComputerName key&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"C:\Windows\System32\windows.exe" sourcetype=windows
[search sourcetype=scanner 
| dedup FQDN 
| rename FQDN as ComputerName
| table ComputerName] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;|table Process ComputerName&lt;BR /&gt;
|join type=outer ComputerName&lt;BR /&gt;
    [search sourcetype=scanner&lt;BR /&gt;
    | dedup FQDN&lt;BR /&gt;
    |rename FQDN as ComputerName&lt;BR /&gt;
    |convert ctime(_time) as time&lt;BR /&gt;
    |stats earliest(time) as et latest(time) as lt by ComputerName IP status]&lt;BR /&gt;
ComputerName is extracted from the sourcetype=scanner which is used in both sub-search search but tabling of fields not happening as expected ? where i am making mistake&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Thu, 24 May 2018 12:08:50 GMT</pubDate>
    <dc:creator>CryoHydra</dc:creator>
    <dc:date>2018-05-24T12:08:50Z</dc:date>
    <item>
      <title>sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409944#M118246</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;had facing issues in using join command , i have two search (sub-search, search)which needs to be joined together.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;sub search :&lt;/P&gt;

&lt;P&gt;"C:\Windows\System32\windows.exe" sourcetype=windows&lt;BR /&gt;
[search sourcetype=scanner &lt;BR /&gt;
| dedup FQDN &lt;BR /&gt;
| rename FQDN as ComputerName] &lt;BR /&gt;
|table Process ComputerName&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;search &lt;/P&gt;

&lt;P&gt;sourcetype=scanner&lt;BR /&gt;
| dedup FQDN&lt;BR /&gt;
|rename FQDN as ComputerName&lt;BR /&gt;
|convert ctime(_time) as time&lt;BR /&gt;
|stats earliest(time) as et latest(time) as lt by ComputerName IP status&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Join both sub-search and search using ComputerName key&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"C:\Windows\System32\windows.exe" sourcetype=windows
[search sourcetype=scanner 
| dedup FQDN 
| rename FQDN as ComputerName
| table ComputerName] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;|table Process ComputerName&lt;BR /&gt;
|join type=outer ComputerName&lt;BR /&gt;
    [search sourcetype=scanner&lt;BR /&gt;
    | dedup FQDN&lt;BR /&gt;
    |rename FQDN as ComputerName&lt;BR /&gt;
    |convert ctime(_time) as time&lt;BR /&gt;
    |stats earliest(time) as et latest(time) as lt by ComputerName IP status]&lt;BR /&gt;
ComputerName is extracted from the sourcetype=scanner which is used in both sub-search search but tabling of fields not happening as expected ? where i am making mistake&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 24 May 2018 12:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409944#M118246</guid>
      <dc:creator>CryoHydra</dc:creator>
      <dc:date>2018-05-24T12:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409945#M118247</link>
      <description>&lt;P&gt;Whats the expected output? Joins are expensive in terms of resources, so if you could tell your expected output (columns in the output, number of rows after join, any sample mock output etc), we can suggest you some efficient workarounds.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 16:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409945#M118247</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-24T16:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409946#M118248</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;from sourcetype=scanner taken vulnerable system-name which do input lookup against sourcetype=windows to get running process.&lt;/P&gt;

&lt;P&gt;then table ComputerName Process&lt;/P&gt;

&lt;P&gt;However i do want to extract other fields from sourcetype=scanner like IP time status which needs to be joined to the above table ?&lt;/P&gt;

&lt;P&gt;Is there any other smart way to achieve this ?&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 02:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409946#M118248</guid>
      <dc:creator>CryoHydra</dc:creator>
      <dc:date>2018-05-25T02:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409947#M118249</link>
      <description>&lt;P&gt;Assuming there will be multiple entries for a ComputerName from sourcetype=windows (say one for each process), and multiple IPs/status/time for ComputerName in sourcetype=scanner, should your final table show many to many join? E.g. if there are two processes running on a ComputerName (2 rows returned from sourcetype=windows) and it changed status/IP twice (2 rows returned from sourcetype=scanner) how many rows should your final table contain? 2-one for each Process/IP-Status OR 4?&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 15:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409947#M118249</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-25T15:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409948#M118250</link>
      <description>&lt;P&gt;Yeah your inference is right but join not at all happening resulting table appear more like append table.&lt;/P&gt;

&lt;P&gt;I even did dedup ComputerName for the sourcetype=windows.&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 04:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409948#M118250</guid>
      <dc:creator>CryoHydra</dc:creator>
      <dc:date>2018-05-26T04:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409949#M118251</link>
      <description>&lt;P&gt;Please try this query if this work then we work on your target step by step&lt;BR /&gt;
C:\Windows\System32\windows.exe" sourcetype=windows&lt;BR /&gt;
     [search sourcetype=scanner &lt;BR /&gt;
     | dedup FQDN &lt;BR /&gt;
     | rename FQDN as ComputerName&lt;BR /&gt;
     | table ComputerName] &lt;BR /&gt;
 |table Process ComputerName&lt;BR /&gt;
 |join type=outer ComputerName&lt;BR /&gt;
     [search sourcetype=scanner&lt;BR /&gt;
      "ComputerName"&lt;BR /&gt;
     |convert ctime(_time) as time&lt;BR /&gt;
     |stats earliest(time) as et latest(time) as lt by ComputerName]&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 05:40:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409949#M118251</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-05-26T05:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409950#M118252</link>
      <description>&lt;P&gt;it won't work since the key "ComputerName" is not present as either value or field on sourcetype=scanner  ? how does it work.&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 06:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409950#M118252</guid>
      <dc:creator>CryoHydra</dc:creator>
      <dc:date>2018-05-26T06:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409951#M118253</link>
      <description>&lt;P&gt;@CryoHydra I think you have misunderstood the purpose of subsearch with table command &lt;CODE&gt;[search ..... | table &amp;lt;returnField&amp;gt;]&lt;/CODE&gt;. In the &lt;CODE&gt;sourcetype windows&lt;/CODE&gt;, your subsearch will add filter for &lt;CODE&gt;ComputerName&lt;/CODE&gt; field with all the values matching in sourcetype scanner. There is a way you can search for just the values (as search pattern) or search for a different fieldname with the values. However, the approach will be dependent on what are existing fieldnames and values and what is the common field/value in both the sourcetypes &lt;CODE&gt;windows&lt;/CODE&gt; and &lt;CODE&gt;scanner&lt;/CODE&gt; that you want to join the result on? &lt;/P&gt;

&lt;P&gt;Similar to how foreign keys work to correlate two tables, you need something common in both the sourcetypes. Can you provide us with this detail?&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 07:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409951#M118253</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-26T07:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: sub-search and then join with another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409952#M118254</link>
      <description>&lt;P&gt;@niketnilay Thank you.&lt;/P&gt;

&lt;P&gt;Common values in both sourcetype is &lt;CODE&gt;hostname&lt;/CODE&gt; however they have different field name (for windows it is ComputerName, for scanner FQDN so i renamed it to ComputerName)&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;sub search extract Process field from the sourcetype=windows for the filtered ComputerName from sourcetype=scanner however i need to join the missing field from the sourcetype=scanner to extracted process and ComputerName field.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 27 May 2018 02:07:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-and-then-join-with-another-search/m-p/409952#M118254</guid>
      <dc:creator>CryoHydra</dc:creator>
      <dc:date>2018-05-27T02:07:51Z</dc:date>
    </item>
  </channel>
</rss>

