<?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 issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-issue/m-p/579145#M201831</link>
    <description>&lt;P&gt;You need to grab the fields from your ST2 data row with rex, e.g. try this example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval x=split("id=1 title=one,id=2 title=two,id=3 title=three", ",")
| mvexpand x
| eval _raw=x
| extract
| table id title _raw
| append [
  | makeresults
  | eval _raw="1 \"GET https://www.example.com?q1=one\"
2 \"GET https://www.example.com?q1=test&amp;amp;q2=test2\"
3 \"GET https://www.example.com?q3=thr\""
  | multikv noheader=t 
  | table _raw
]
| rex field=_raw "^(?&amp;lt;id&amp;gt;\d+).*\?(?&amp;lt;params&amp;gt;.*)"
| stats values(*) as * by id
| table id title params&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note that the rex statement must only grab the id and params from the ST2 sourcetypes, so this relies on _raw from ST1 NOT matching the rex pattern, so that id from the ST1 is not overwritten by an extraction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Dec 2021 21:43:18 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2021-12-22T21:43:18Z</dc:date>
    <item>
      <title>Join issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-issue/m-p/579140#M201827</link>
      <description>&lt;P&gt;I want to join two source types ST1(has fields id,title) and ST2(no fields only _raw="xid &lt;A href="https://www.example.com?q1=test1&amp;amp;q2=test2" target="_blank"&gt;https://www.example.com?q1=test1&amp;amp;q2=test2&lt;/A&gt;") . I have tried via join it is working but due to sub search row constraint, I&amp;nbsp; am getting wrong result. I have tried without join(sourcetype="ST1" OR sourcetype="ST2" approach), I am getting incorrect result.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sourcetype="ST1" (id,title are fields here)&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;id=1 title=one&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;id=2 title=two&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&amp;nbsp;id=3 title=three&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;sourcetype="ST2"&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;_raw&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;1 "GET&amp;nbsp;&lt;A href="https://www.example.com?q1=one" target="_blank"&gt;https://www.example.com?q1=one"&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;2 "GET&amp;nbsp;&lt;A href="https://www.example.com?q1=test&amp;amp;q2=test2" target="_blank"&gt;https://www.example.com?q1=test&amp;amp;q2=test2"&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&amp;nbsp;3 "GET&amp;nbsp;&lt;A href="https://www.example.com?q3=thr" target="_blank"&gt;https://www.example.com?q3=thr"&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;I want to join these source types and get the below output(grab the url params alone in source type ST2). Can you please help me on this?&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;id&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;title&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;params&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;one&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;q1=one&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;two&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;q1=test&amp;amp;q2=test2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;3&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;three&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;q3=thr&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 22 Dec 2021 20:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-issue/m-p/579140#M201827</guid>
      <dc:creator>v11n</dc:creator>
      <dc:date>2021-12-22T20:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Join issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-issue/m-p/579144#M201830</link>
      <description>&lt;P&gt;Use stats and combine the searches whenever possible since its much more efficient.&lt;/P&gt;&lt;P&gt;Here's a possible way to skinning it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(sourcetype="ST1" OR sourcetype="ST2")
| fields _time id title _raw
| rex field=_raw "^(?&amp;lt;event_id&amp;gt;\d+)\s\"(?&amp;lt;event_type&amp;gt;[^\s]*)\s(?&amp;lt;base_url&amp;gt;[^\?]*)(\?(?&amp;lt;params&amp;gt;[^\"]*))?"
| eval id=COALESCE(id, event_id)
| stats values(event_id) AS event_id values(base_url) AS base_url values(params) AS params max(title) AS title values(event_type) AS event_type max(_time) AS _time by id
| table _time id title event_type base_url params&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 21:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-issue/m-p/579144#M201830</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2021-12-22T21:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Join issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-issue/m-p/579145#M201831</link>
      <description>&lt;P&gt;You need to grab the fields from your ST2 data row with rex, e.g. try this example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval x=split("id=1 title=one,id=2 title=two,id=3 title=three", ",")
| mvexpand x
| eval _raw=x
| extract
| table id title _raw
| append [
  | makeresults
  | eval _raw="1 \"GET https://www.example.com?q1=one\"
2 \"GET https://www.example.com?q1=test&amp;amp;q2=test2\"
3 \"GET https://www.example.com?q3=thr\""
  | multikv noheader=t 
  | table _raw
]
| rex field=_raw "^(?&amp;lt;id&amp;gt;\d+).*\?(?&amp;lt;params&amp;gt;.*)"
| stats values(*) as * by id
| table id title params&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note that the rex statement must only grab the id and params from the ST2 sourcetypes, so this relies on _raw from ST1 NOT matching the rex pattern, so that id from the ST1 is not overwritten by an extraction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 21:43:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-issue/m-p/579145#M201831</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-12-22T21:43:18Z</dc:date>
    </item>
  </channel>
</rss>

