<?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: How to remove limitations of join command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308955#M163576</link>
    <description>&lt;P&gt;hey try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index sourcetype=csv source=src1 host=host1 
| stats count by field1 field2 field3 field3 ITEM 
| fields - count 
| rename field1 as F_1 field2 as F_2 field3 as F_3 
| join ITEM 
    [ search index=index sourcetype=csv source=src2 host=host2 
    | stats count by c_1 c_2 c_3 SKU 
    | fields - count 
    | rename SKU as ITEM] 
| eval DIFF1=F1-c_1 
| eval DIFF2=F_2-c_2 
| sort limit=0 ITEM 
| table ITEM, F_1, F_2, F_3, c_1, c_2, c_3, DIFF1, DIFF2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2018 11:20:41 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-01-17T11:20:41Z</dc:date>
    <item>
      <title>How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308951#M163572</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm using the join command to join to searches based on a common field called ITEM. Based on this join, I want to return results from both searches only in instances where ITEM values match. However, I'm not sure it's working correctly. Could you please have a look at my query and let me know where I'm going wrong and what I could do to avoid using a join command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index sourcetype=csv source=src1 host=host1| stats list(field1) as F_1 list(field2) as F_2 list(field3) as F_3 BY ITEM| eval source1=mvzip(F_1,mvzip(F_2,F_3)) | mvexpand source1 | rex field=source1 "(?&amp;lt;F_1&amp;gt;\d+),(?&amp;lt;F_2&amp;gt;\d+),(?&amp;lt;F_3&amp;gt;\d+)" | join ITEM [search index=index sourcetype=csv source=src2 host=host2| stats list(c_1) as C_1 list(c_2) as C_2 list(c_3) as C_3 BY SKU | eval source2=mvzip(C_1 ,mvzip(C_2,C_3)) | mvexpand source2| rex field=source2 "(?&amp;lt;C_1 &amp;gt;\d+),(?&amp;lt;C_2 &amp;gt;\d+),(?&amp;lt;C_3&amp;gt;\d+)" |rename SKU as ITEM] | eval DIFF1=F1-C_1 | eval DIFF2=F_2-C_2 | sort limit=0 ITEM |table ITEM, F_1, F_2, F_3, C_1, C_2, C_3, DIFF1, DIFF2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone please check my query as I think there may be a mistake in there somewhere when attempting to create new records for instances where there are multiple values in a single field.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 10:04:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308951#M163572</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-17T10:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308952#M163573</link>
      <description>&lt;P&gt;I do not understand your query. from the query i think you are extracting numbers i.e. &lt;CODE&gt;(?&amp;lt;F_1&amp;gt;\d+),(?&amp;lt;F_2&amp;gt;\d+),(?&amp;lt;F_3&amp;gt;\d+)&lt;/CODE&gt; and from src2 you are extracting &lt;CODE&gt;(?&amp;lt;C_1 &amp;gt;\w+),(?&amp;lt;C_2 &amp;gt;\w+),(?&amp;lt;C_3&amp;gt;\w+)&lt;/CODE&gt; words and then you are substracting integer-string?&lt;BR /&gt;
Also in addition to that F_1 F_2 F_3 ITEM are in one event for src1 and same for src2?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308952#M163573</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2020-09-29T17:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308953#M163574</link>
      <description>&lt;P&gt;Hi mayurr98, apologies, it shouldn't be w+, it should be d+. As for your second question,  yes thats correct, but ITEM in src2 is called SKU, which I am renaming as ITEM so I can do the join&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 10:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308953#M163574</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-17T10:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308954#M163575</link>
      <description>&lt;P&gt;@mayurr98, do you have any idea what I might be doing wrong here?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 10:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308954#M163575</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-17T10:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308955#M163576</link>
      <description>&lt;P&gt;hey try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index sourcetype=csv source=src1 host=host1 
| stats count by field1 field2 field3 field3 ITEM 
| fields - count 
| rename field1 as F_1 field2 as F_2 field3 as F_3 
| join ITEM 
    [ search index=index sourcetype=csv source=src2 host=host2 
    | stats count by c_1 c_2 c_3 SKU 
    | fields - count 
    | rename SKU as ITEM] 
| eval DIFF1=F1-c_1 
| eval DIFF2=F_2-c_2 
| sort limit=0 ITEM 
| table ITEM, F_1, F_2, F_3, c_1, c_2, c_3, DIFF1, DIFF2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 11:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308955#M163576</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-17T11:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308956#M163577</link>
      <description>&lt;P&gt;Quick question, why did you add ITEM at the end? Because field1 is basically my item field&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 11:26:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308956#M163577</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-17T11:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308957#M163578</link>
      <description>&lt;P&gt;it does not matter here, list command grabs everything into one command, while this will separate out everything so ITEM will get repeated many times.I do not think there is any problem with this search. Are you getting results?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 11:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308957#M163578</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-17T11:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308958#M163579</link>
      <description>&lt;P&gt;@mmayurr98 its taking a very long time to produce the results. I still haven't received anything.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 12:15:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308958#M163579</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-17T12:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308959#M163580</link>
      <description>&lt;P&gt;@mayurr98, Hi this works partially. It's not separating one of the fields in the sub search. It's just repeating it.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 08:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308959#M163580</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-18T08:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove limitations of join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308960#M163581</link>
      <description>&lt;P&gt;HI&lt;/P&gt;

&lt;P&gt;Can you please try this search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index sourcetype=csv source=src1 host=host1 
| stats list(field1) as F_1 list(field2) as F_2 list(field3) as F_3 BY ITEM 
| eval source1=mvzip(F_1,mvzip(F_2,F_3)) 
| mvexpand source1 
| rex field=source1 "(?&amp;lt;F_1&amp;gt;\d+),(?&amp;lt;F_2&amp;gt;\d+),(?&amp;lt;F_3&amp;gt;\d+)" 
| append  
    [ search index=index sourcetype=csv source=src2 host=host2 
    | stats list(c_1) as C_1 list(c_2) as C_2 list(c_3) as C_3 BY SKU 
    | eval source2=mvzip(C_1 ,mvzip(C_2,C_3)) 
    | mvexpand source2 
    | rex field=source2 "(?&amp;lt;C_1 &amp;gt;\d+),(?&amp;lt;C_2 &amp;gt;\d+),(?&amp;lt;C_3&amp;gt;\d+)" 
    | rename SKU as ITEM] 
| stats values(F_1) as F_1 values(F_2) as F_2 values(F_3) as F_3 values(C_1) as C_1 values(C_2) as C_2 values(C_3) as C_3 by ITEM
| eval DIFF1=F_1-C_1 
| eval DIFF2=F_2-C_2 
| sort limit=0 ITEM 
| table ITEM, F_1, F_2, F_3, C_1, C_2, C_3, DIFF1, DIFF2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jan 2018 17:29:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-limitations-of-join-command/m-p/308960#M163581</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-01-18T17:29:10Z</dc:date>
    </item>
  </channel>
</rss>

