<?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 Which record does a join function look at in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Which-record-does-a-join-function-look-at/m-p/657459#M227092</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am looking at an alert that is using a join function to match a work_center with a work order. I am wondering what records in a stream of records the join is looking at to get that result? Is there a way to get the latest result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To explain further, the work center in some cases will change based on where work is being completed, so I would like to grab the latest result when the alert runs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current code I am looking at using this give us a way to compare the work center in the source="punch" vs the current stream of data. I am wondering if I can further manipulate that subsearch to look at the last result in source="punch". I tried a couple things but didn't have any luck. Not super familiar with joins in my normal work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;| join cwo type left&lt;BR /&gt;[search source=punch&lt;BR /&gt;| rename work_center as position]&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 16:42:47 GMT</pubDate>
    <dc:creator>strehb18</dc:creator>
    <dc:date>2023-09-13T16:42:47Z</dc:date>
    <item>
      <title>Which record does a join function look at</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-record-does-a-join-function-look-at/m-p/657459#M227092</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am looking at an alert that is using a join function to match a work_center with a work order. I am wondering what records in a stream of records the join is looking at to get that result? Is there a way to get the latest result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To explain further, the work center in some cases will change based on where work is being completed, so I would like to grab the latest result when the alert runs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current code I am looking at using this give us a way to compare the work center in the source="punch" vs the current stream of data. I am wondering if I can further manipulate that subsearch to look at the last result in source="punch". I tried a couple things but didn't have any luck. Not super familiar with joins in my normal work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;| join cwo type left&lt;BR /&gt;[search source=punch&lt;BR /&gt;| rename work_center as position]&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 16:42:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-record-does-a-join-function-look-at/m-p/657459#M227092</guid>
      <dc:creator>strehb18</dc:creator>
      <dc:date>2023-09-13T16:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Which record does a join function look at</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-record-does-a-join-function-look-at/m-p/657537#M227119</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/227032"&gt;@strehb18&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if your requirement is to have only the last result and only one event, you could use something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| join cwo type left
[search 
   source=punch index=your_index
   | rename work_center as position
   | sort -_time
   | head 1 ]&lt;/LI-CODE&gt;&lt;P&gt;Only one hint: the join command is a very slow command and it consumes many resources; there are usually other solutions to replace the join command, e.g. the stats command, but this depends on your use case.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 06:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-record-does-a-join-function-look-at/m-p/657537#M227119</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-09-14T06:47:58Z</dc:date>
    </item>
  </channel>
</rss>

