Splunk Search

How to join log file with a lookup file?

poojamande
New Member

I have indexed one log file in which Job name, job status and time are the fileds. Also, I have one lookup file which is having the job name and its upstream and downstream, sla information etc. Need to join the static lookup file with real time indexed log file.
eg. |inputlookup FeedLookup1.csv |join JobName [search index=feed sourcetype=autosys|fillnull value=NA |table JobName]| table JobName, status
Here I don't get any data from log file. Results populates only from lookup file.
Please suggest.

Tags (1)
0 Karma
1 Solution

sundareshr
Legend

Depending on what you're looking for, you may not need to join the two. If you want the upstream and downstream sla based on JobName, you should use the lookup command. Try this

`index=feed sourcetype=autosys|fillnull value=NA |` lookup JobName as JobName OUTPUT upstream_sla AS upstream_sla downstream_sla AS downstream_sla | table JobName *sla status

Make sure field names and values are identical between log file and lookupfile.

If you are only interested in returning Jobs from the log file, that have a corresponding entry in the lookup file, try this

index=feed sourcetype=autosys [inputlookup lookupfile.csv | table JobName] | ...

View solution in original post

0 Karma

sundareshr
Legend

Depending on what you're looking for, you may not need to join the two. If you want the upstream and downstream sla based on JobName, you should use the lookup command. Try this

`index=feed sourcetype=autosys|fillnull value=NA |` lookup JobName as JobName OUTPUT upstream_sla AS upstream_sla downstream_sla AS downstream_sla | table JobName *sla status

Make sure field names and values are identical between log file and lookupfile.

If you are only interested in returning Jobs from the log file, that have a corresponding entry in the lookup file, try this

index=feed sourcetype=autosys [inputlookup lookupfile.csv | table JobName] | ...
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...