<?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: Join search with multi-values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90191#M23150</link>
    <description>&lt;P&gt;thanks this was what I was looking for, much appreciated&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2013 13:08:27 GMT</pubDate>
    <dc:creator>pbarford</dc:creator>
    <dc:date>2013-10-09T13:08:27Z</dc:date>
    <item>
      <title>Join search with multi-values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90188#M23147</link>
      <description>&lt;P&gt;I have a join on two searches, from the first search, the data return is the same as the following table (equivalent of running this)&lt;/P&gt;

&lt;P&gt;source="/home/pbarford/tmp/300913/resequencer/reseq01-application.2013-09-30.log" | search "Expiry" | rex "[nike.(?&lt;EVENTID&gt;[0-9]{1,45})]" | rex max_match=20 "L[(?&lt;SEQNO&gt;[0-9]{1,45})]" | fields eventid, seqno | table eventid, seqno&lt;/SEQNO&gt;&lt;/EVENTID&gt;&lt;/P&gt;

&lt;P&gt;eventid,     seqno&lt;BR /&gt;
1                22&lt;BR /&gt;
                  45&lt;BR /&gt;
                  67&lt;BR /&gt;
2                2&lt;BR /&gt;
3                5&lt;/P&gt;

&lt;P&gt;So I want is to take the eventid and seqno and join it to the next query. Problem is that a join on eventid "1", as shown above, is not being done. For eventid 2 &amp;amp; 3 the join is being done. I am assuming this is due to the fact that for 1 their are multi-values in the seqno column. What is the best way around this problem?&lt;/P&gt;

&lt;P&gt;The full query is below&lt;/P&gt;

&lt;P&gt;sourcetype="logtype1" | search "Expiry" | rex "[nike.(?&lt;EVENTID&gt;[0-9]{1,45})]" | rex max_match=20 "L[(?&lt;SEQNO&gt;[0-9]{1,45})]" | fields eventid, seqno | join eventid, seqno [ search sourcetype="logtype2" "Inserted" | rex "EventId: (?&lt;EVENTID&gt;\d+)" | rex "SeqNo: (?&lt;SEQNO&gt;\d+)" | rex "Duration: (?&lt;DURATION&gt;\d+)" | fields eventid, seqno, duration ] | table eventid, seqno, duration&lt;/DURATION&gt;&lt;/SEQNO&gt;&lt;/EVENTID&gt;&lt;/SEQNO&gt;&lt;/EVENTID&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2013 11:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90188#M23147</guid>
      <dc:creator>pbarford</dc:creator>
      <dc:date>2013-10-09T11:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Join search with multi-values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90189#M23148</link>
      <description>&lt;P&gt;I think a subsearch might work more effectively. Use the logtype1 search to search the logtype2 events. The format returned from the subsearch should be &lt;CODE&gt;(eventid=1 AND seqno=22) OR (eventid=1 AND seqno=45) ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="logtype2" "Inserted" | rex "EventId: (?&amp;lt;eventid&amp;gt;d+)" | rex "SeqNo: (?&amp;lt;seqno&amp;gt;d+)" | rex "Duration: (?&amp;lt;duration&amp;gt;d+)" | search [search sourcetype=logtype1 "Expiry" | rex  "[nike.(?&amp;lt;eventid&amp;gt;[0-9]{1,45})]" | rex max_match=20 "L[(?&amp;lt;seqno&amp;gt;[0-9]{1,45})]" | fields eventid, seqno ]  | table eventid, seqno, duration&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2013 11:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90189#M23148</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-10-09T11:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Join search with multi-values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90190#M23149</link>
      <description>&lt;P&gt;Try using &lt;STRONG&gt;mvexpand&lt;/STRONG&gt;, which will make an individual event out of all the combinations of eventid and seqno for each record in your table, i.e.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventid      seqno
-------------------
1            22
             45
             67
2            2
3            5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;becomes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventid      seqno
-------------------
1            22
1            45
1            67
2            2
3            5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So your search would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="logtype1" "Expiry" 
| rex "[nike.(?&amp;lt;eventid&amp;gt;[0-9]{1,45})]" 
| rex max_match=20 "L[(?&amp;lt;seqno&amp;gt;[0-9]{1,45})]" 
| fields eventid, seqno 
| mvexpand seqno 
| join eventid, seqno [ search sourcetype="logtype2" "Inserted" 
| rex "EventId: (?&amp;lt;eventid&amp;gt;d+)" 
| rex "SeqNo: (?&amp;lt;seqno&amp;gt;d+)" 
| rex "Duration: (?&amp;lt;duration&amp;gt;d+)" 
| fields eventid, seqno, duration ] 
| table eventid, seqno, duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2013 12:02:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90190#M23149</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2013-10-09T12:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Join search with multi-values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90191#M23150</link>
      <description>&lt;P&gt;thanks this was what I was looking for, much appreciated&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2013 13:08:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-search-with-multi-values/m-p/90191#M23150</guid>
      <dc:creator>pbarford</dc:creator>
      <dc:date>2013-10-09T13:08:27Z</dc:date>
    </item>
  </channel>
</rss>

