Splunk Search

Joining data

jimjohn
Path Finder

Hi All,
This is a repeated question.I am posting it again because I cant find a solution.

I have 2 data sets which contain a common data.(Columns names are different in 2 data set).
Ex:
Data1 Data2
EmpId EId
Name Visit
Age
EmpId and EId are columns I want to join.
In Data1 and Data2 have one to many relations.
Both of this data set will be loaded in splunk on daily basis.So I want to join them and show the result on a day by basis (like timechart does).
Ie I want to join today's Data1 with today's Data2.

I tired below things but both of them doesn't work out.

1)host=Data1 OR Data2| eval employerCode = if(host="Data1","EId", employer_code) |transaction employerCode maxspan=1d

2)host=Data1|join EmpId [search host=Data2 | eval "EId"=EmpId]|eventstats .....

can anybody help me?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try 'host=Data1 | rename EmpId AS employerCode | join employerCode [search host=Data2 | rename EId AS employerCode ... '. Of course, this means any downstream use of EmpId or EId will have to use employerCode instead.

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please accept the answer.

---
If this reply helps you, Karma would be appreciated.
0 Karma

jimjohn
Path Finder

Thanks man...It works out....

0 Karma
Get Updates on the Splunk Community!

Part 2: A Guide to Maximizing Splunk IT Service Intelligence

Welcome to the second segment of our guide. In Part 1, we covered the essentials of getting started with ITSI ...

Part 1: A Guide to Maximizing Splunk IT Service Intelligence

As modern IT environments continue to grow in complexity and speed, the ability to efficiently manage and ...

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...