<?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: Can anyone suggest how I can create a join query using pattern in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499208#M139052</link>
    <description>&lt;P&gt;This information should have been included in the question.&lt;BR /&gt;
@to4kawa's answer should do the job.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Nov 2019 12:50:47 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-11-30T12:50:47Z</dc:date>
    <item>
      <title>Can anyone suggest how I can create a join query using pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499204#M139048</link>
      <description>&lt;P&gt;Eg&lt;BR /&gt;
eg in fuse.log I have a entry like  userId=abc&lt;BR /&gt;
while in access.log i have entry like sessionid-12232 | abc | xyz&lt;BR /&gt;
Output I want is like &lt;BR /&gt;
abc | xyz | sessionid-12232&lt;BR /&gt;
Can you please suggest how can i join these two using pattern&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 10:30:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499204#M139048</guid>
      <dc:creator>ayush8878</dc:creator>
      <dc:date>2019-11-29T10:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone suggest how I can create a join query using pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499205#M139049</link>
      <description>&lt;P&gt;Assuming access.log has fields 'sessionid', 'userid', and 'foo' and they're already extracted then this should get you started.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=fuse.log OR source=access.log | stats values(*) as * by userid | table userid foo sessionid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Nov 2019 04:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499205#M139049</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-11-30T04:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone suggest how I can create a join query using pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499206#M139050</link>
      <description>&lt;P&gt;hey, Thank you very much for the response but the scenario is little different&lt;BR /&gt;
in fuse.log I have fields like &lt;BR /&gt;
userId=abc | session=123 | time=12:00 IST&lt;BR /&gt;
so splunk is able to concider then as 3 fields i.e. userId,session,time&lt;BR /&gt;
while in access.log i only have values but not field name i.e &lt;BR /&gt;
foo-abc-12:00 IST-data&lt;BR /&gt;
What  I need to achieve is get the userid from fuse.log and find that id in access.log and print userid |session | data&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2019 10:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499206#M139050</guid>
      <dc:creator>ayush8878</dc:creator>
      <dc:date>2019-11-30T10:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone suggest how I can create a join query using pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499207#M139051</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="userId=abc,session=123,time=12:00_IST"
| kv
| eval time=replace(time,"_"," ")
| append 
    [| makeresults 
    | eval _raw="foo-abc-12:00 IST-data" ]
`comment("this is sample data")`
| rex "(?&amp;lt;user&amp;gt;[^\-]+)-(?&amp;lt;userId&amp;gt;[^\-]+)-(?&amp;lt;time&amp;gt;[^\-]+)-(?&amp;lt;data&amp;gt;.+)"
| stats values(*) as * by userId 
| eval session="sessionid-".session
| table userId user session
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I uased @richgalloway  's query, thanks.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source=fuse.log OR source=access.log 
| rex "(?&amp;lt;user&amp;gt;[^\-]+)-(?&amp;lt;userId&amp;gt;[^\-]+)-(?&amp;lt;time&amp;gt;[^\-]+)-(?&amp;lt;data&amp;gt;.+)"
| stats values(*) as * by userid 
| eval session="sessionid-".session
| table userid user sessionid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How about this?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2019 10:43:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499207#M139051</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-30T10:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone suggest how I can create a join query using pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499208#M139052</link>
      <description>&lt;P&gt;This information should have been included in the question.&lt;BR /&gt;
@to4kawa's answer should do the job.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2019 12:50:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499208#M139052</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-11-30T12:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone suggest how I can create a join query using pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499209#M139053</link>
      <description>&lt;P&gt;Thanks @richgalloway @to4kawa &lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 16:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-suggest-how-I-can-create-a-join-query-using-pattern/m-p/499209#M139053</guid>
      <dc:creator>ayush8878</dc:creator>
      <dc:date>2019-12-02T16:58:44Z</dc:date>
    </item>
  </channel>
</rss>

