<?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: Real-time inner join in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339794#M100790</link>
    <description>&lt;P&gt;I came up with a shady solution for this:&lt;BR /&gt;
    ...&lt;BR /&gt;
    | eval combinedField = Field1 + "~" + State1&lt;BR /&gt;
    | eventstats values(combinedField) as combinedField by sharedField&lt;BR /&gt;
    | stats values(combinedField) as combinedField by sharedField, Field2&lt;BR /&gt;
    | mvexpand combinedField&lt;BR /&gt;
    | rex field=inputCombined "(?&lt;FIELD1&gt;.&lt;EM&gt;)~(?&lt;STATE1&gt;.&lt;/STATE1&gt;&lt;/EM&gt;)"&lt;BR /&gt;
    | stats values(Field1) as Field1, values(State1) as State1, values(State2) as State2 by sharedField, Field2&lt;/FIELD1&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2017 16:50:08 GMT</pubDate>
    <dc:creator>eroffol</dc:creator>
    <dc:date>2017-10-31T16:50:08Z</dc:date>
    <item>
      <title>Real-time inner join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339793#M100789</link>
      <description>&lt;P&gt;I have data that looks like this:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3756iF9FB7BCC8716ADF1/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I would like to join it in such a way to make it look like this:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3757iC1A00F530BAFD373/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
This must work in real-time, so joins or subsearches are out the window.  I have been messing around with stats, and eventstats, but can't seem to find a way to keep the values in the state field correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 14:46:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339793#M100789</guid>
      <dc:creator>eroffol</dc:creator>
      <dc:date>2017-10-31T14:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time inner join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339794#M100790</link>
      <description>&lt;P&gt;I came up with a shady solution for this:&lt;BR /&gt;
    ...&lt;BR /&gt;
    | eval combinedField = Field1 + "~" + State1&lt;BR /&gt;
    | eventstats values(combinedField) as combinedField by sharedField&lt;BR /&gt;
    | stats values(combinedField) as combinedField by sharedField, Field2&lt;BR /&gt;
    | mvexpand combinedField&lt;BR /&gt;
    | rex field=inputCombined "(?&lt;FIELD1&gt;.&lt;EM&gt;)~(?&lt;STATE1&gt;.&lt;/STATE1&gt;&lt;/EM&gt;)"&lt;BR /&gt;
    | stats values(Field1) as Field1, values(State1) as State1, values(State2) as State2 by sharedField, Field2&lt;/FIELD1&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 16:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339794#M100790</guid>
      <dc:creator>eroffol</dc:creator>
      <dc:date>2017-10-31T16:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time inner join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339795#M100791</link>
      <description>&lt;P&gt;This line: &lt;CODE&gt;| stats values(combinedField) as combinedField by sharedField, Field2&lt;/CODE&gt; should be &lt;CODE&gt;| stats values(combinedField) as combinedField, values(State2) as State2 by sharedField, Field2&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 16:52:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339795#M100791</guid>
      <dc:creator>eroffol</dc:creator>
      <dc:date>2017-10-31T16:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time inner join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339796#M100792</link>
      <description>&lt;P&gt;Revised solution since I can't edit my original answer:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| eval combinedField = Field1 + "~" + State1
| eventstats values(combinedField) as combinedField by sharedField
| stats values(combinedField) as combinedField, values(State2) as State2 by sharedField, Field2
| mvexpand combinedField
| rex field=inputCombined "(?&amp;lt;Field1&amp;gt;.*)~(?&amp;lt;State1&amp;gt;.*)"
| stats values(Field1) as Field1, values(State1) as State1, values(State2) as State2 by sharedField, Field2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2017 16:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Real-time-inner-join/m-p/339796#M100792</guid>
      <dc:creator>eroffol</dc:creator>
      <dc:date>2017-10-31T16:57:51Z</dc:date>
    </item>
  </channel>
</rss>

