<?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 Join not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490621#M136994</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;index="event"
| rex field=Macaddress mode=sed "s/(.{2})/\1-/g s/-$//"
 | rename Macaddress as "macAddress" 
| eval SessionTime_epoch = strptime(SessionTime, "%Y-%m-%dT%H:%M:%S.%3NZ")
 | eval SessionTime = strftime(SessionTime_epoch, "%Y-%m-%d %H:%M:%S")
| join macAddress type=outer
    [inputlookup nctdata.csv]
| rename cubicleNo as "work_station" | join work_station type=outer
    [inputlookup somaster.csv]
|table Username,macAddress,Session,SessionTime,SystemName,cubliceNo,vlanNo, c_occupiedclient
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My query is something like this. But i am not getting the results correctly. I want the fields as I have mentioned above. I want Username,macAddress,Session,SessionTime,SystemName from "event" file and join macAddress in nctdata and get these columns in nctdata file: cubliceNo,vlanNo and join work_station in nctdata and somaster file and take these column in somaster:c_occupiedclient.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:21:04 GMT</pubDate>
    <dc:creator>kavyamohan</dc:creator>
    <dc:date>2020-09-30T02:21:04Z</dc:date>
    <item>
      <title>Join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490621#M136994</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="event"
| rex field=Macaddress mode=sed "s/(.{2})/\1-/g s/-$//"
 | rename Macaddress as "macAddress" 
| eval SessionTime_epoch = strptime(SessionTime, "%Y-%m-%dT%H:%M:%S.%3NZ")
 | eval SessionTime = strftime(SessionTime_epoch, "%Y-%m-%d %H:%M:%S")
| join macAddress type=outer
    [inputlookup nctdata.csv]
| rename cubicleNo as "work_station" | join work_station type=outer
    [inputlookup somaster.csv]
|table Username,macAddress,Session,SessionTime,SystemName,cubliceNo,vlanNo, c_occupiedclient
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My query is something like this. But i am not getting the results correctly. I want the fields as I have mentioned above. I want Username,macAddress,Session,SessionTime,SystemName from "event" file and join macAddress in nctdata and get these columns in nctdata file: cubliceNo,vlanNo and join work_station in nctdata and somaster file and take these column in somaster:c_occupiedclient.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:21:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490621#M136994</guid>
      <dc:creator>kavyamohan</dc:creator>
      <dc:date>2020-09-30T02:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490622#M136995</link>
      <description>&lt;P&gt;Hi kavyamohan,&lt;BR /&gt;
the join command is a very slow solution and has the limit of 50,000 results because there's a subsearch.&lt;BR /&gt;
In your case you want to do a join with a lookup, to do this you don't need of join and you can use the lookup command that's like a join.&lt;BR /&gt;
Don't think to Splunk as a DB, it's different!&lt;/P&gt;

&lt;P&gt;Instead, try to use a different approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="event"
| rex field=Macaddress mode=sed "s/(.{2})/\1-/g s/-$//"
| rename Macaddress as "macAddress" 
| eval SessionTime_epoch = strptime(SessionTime, "%Y-%m-%dT%H:%M:%S.%3NZ"), SessionTime = strftime(SessionTime_epoch, "%Y-%m-%d %H:%M:%S")
| lookup nctdata.csv macAddress OUTPUT cubicleNo 
| rename cubicleNo as "work_station" 
| lookup somaster.csv work_station OUTPUT cubliceNo vlanNo
| table Username macAddress Session SessionTime SystemName cubliceNo vlanNo c_occupiedclient
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In addition, when you use the inputlookup command you have to always use the pipe char "|".&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 12:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490622#M136995</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-27T12:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490623#M136996</link>
      <description>&lt;P&gt;You can even simplify the &lt;CODE&gt;eval&lt;/CODE&gt; further:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval SessionTime = (strftime(strptime(SessionTime, "%Y-%m-%dT%H:%M:%S.%3NZ"), "%Y-%m-%d %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Sep 2019 15:04:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490623#M136996</guid>
      <dc:creator>wmyersas</dc:creator>
      <dc:date>2019-09-27T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490624#M136997</link>
      <description>&lt;P&gt;Thank you so much it worked:)&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 04:51:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-not-working/m-p/490624#M136997</guid>
      <dc:creator>kavyamohan</dc:creator>
      <dc:date>2019-10-04T04:51:13Z</dc:date>
    </item>
  </channel>
</rss>

