<?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: Using Join (or similar command) for One to Many Relationship in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85969#M21942</link>
    <description>&lt;P&gt;Assuming the search and subsearch were correct of course. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2013 20:27:23 GMT</pubDate>
    <dc:creator>cpeteman</dc:creator>
    <dc:date>2013-07-05T20:27:23Z</dc:date>
    <item>
      <title>Using Join (or similar command) for One to Many Relationship</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85967#M21940</link>
      <description>&lt;P&gt;I have a log file that is writing session data for users using an application in a csv format. The session data provides information about each transaction using "Meta" events and action information (Page Loads, Application Initialization). The sessionId is common to both types of events and is used to link the events. There is a one to many relationship between the action events and the meta events. (Each Action Event will have many Meta Events associated with it.) &lt;/P&gt;

&lt;P&gt;I want to write a search that will add the information provided from the Meta information to the action information. I started using a join, but after running the search it looks like the search is only pulling back the meta information from the first meta tag. I have been able to push this data to Hadoop and run Ruby to "Sessionize" the data, but I want to be able to do this directly in Splunk. &lt;/P&gt;

&lt;P&gt;Below is the join search. Is "Join" the right search to create a one to many relationship? Can I create a Subtable of Meta Data to each action event?&lt;/P&gt;

&lt;P&gt;index=prod_ui sourcetype=ui_instrumentation Type=init OR Type=view | rename Type AS Type1 | rename SubjectName AS SubjectName1 | rename DataValue AS DataValue1 |  table _time, SessionId, Type1, SubjectName1, DataValue1, Duration | join SessionId [search index=prod_ui sourcetype=ui_instrumentation Type=meta | table SessionId, DataValue, SubjectName, Type]&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85967#M21940</guid>
      <dc:creator>ezajac</dc:creator>
      <dc:date>2020-09-28T14:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Join (or similar command) for One to Many Relationship</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85968#M21941</link>
      <description>&lt;P&gt;I had a vaguely similar problem a few weeks ago. The best solution seems to be using append and selfjoin instead of join. Try the following&lt;/P&gt;

&lt;P&gt;index=prod_ui sourcetype=ui_instrumentation Type=init OR Type=view | rename Type AS Type1 | rename SubjectName AS SubjectName1 | rename DataValue AS DataValue1 | table _time, SessionId, Type1, SubjectName1, DataValue1, Duration | append [search index=prod_ui sourcetype=ui_instrumentation Type=meta | table SessionId, DataValue, SubjectName, Type] | selfjoin SessionId&lt;/P&gt;

&lt;P&gt;That doesn't work right let me know what it does versus what you want I'll be glad to take another look.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85968#M21941</guid>
      <dc:creator>cpeteman</dc:creator>
      <dc:date>2020-09-28T14:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Join (or similar command) for One to Many Relationship</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85969#M21942</link>
      <description>&lt;P&gt;Assuming the search and subsearch were correct of course. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2013 20:27:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85969#M21942</guid>
      <dc:creator>cpeteman</dc:creator>
      <dc:date>2013-07-05T20:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Join (or similar command) for One to Many Relationship</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85970#M21943</link>
      <description>&lt;P&gt;The join command contains an option called &lt;STRONG&gt;max=int&lt;/STRONG&gt; that is used to specify how many subsearch results can join with main search results.&lt;/P&gt;

&lt;P&gt;In your query, just write &lt;STRONG&gt;join max=0 SessionId&lt;/STRONG&gt; in place of join SessionId. &lt;BR /&gt;
When max is set to 0 there is no limit.&lt;/P&gt;

&lt;P&gt;,&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2018 11:29:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Join-or-similar-command-for-One-to-Many-Relationship/m-p/85970#M21943</guid>
      <dc:creator>darshildave</dc:creator>
      <dc:date>2018-05-28T11:29:55Z</dc:date>
    </item>
  </channel>
</rss>

