Dashboards & Visualizations

How to Join Alert lookup file with a mapping file depending on pattern search?

jinishshah
Explorer

Hello,

I have a alert dump data Horizon.csv having important columns like below:

Alert   GRN   Type ....

PNC/hz-hfp-l-abc[MAXRUN]      PNC/hz-hfp-l-abc   Autosys

Filesystem[ivp1234.xy.com] [91>90]   ivp1234.xy.com   Application

Filesystem[ivp1244.xy.com] [91>90]   ivp1244.xy.com   Application

p.start.script.pl is down     Process down   API

which I need to merge with Mapping.csv but on a condition that if Type=Autosys then merge on GRN else merge on Type

details of Mapping.csv

Type   Name   Module    Header

Autosys   hz-hfp-l-abc   HF   EOD Job

Application   <blank>   Eng   Server alerts

API   <blank>   LF   Service alerts   

I need output as 

Alert   GRN   Type   Module   Header

PNC/hz-hfp-l-abc[MAXRUN]      PNC/hz-hfp-l-abc   Autosys   HF   EOD Job

Filesystem[ivp1234.xy.com] [91>90]   ivp1234.xy.com   Application   Eng   Server alerts

Filesystem[ivp1244.xy.com] [91>90]   ivp1244.xy.com   Application   Eng   Server alerts

p.start.script.pl is down     Process down   API   LF Service alerts

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| inputlookup Horizon.csv
| eval Name=if(Type="Autosys",GRN,"all")
| lookup Mapping.csv Type Name

View solution in original post

0 Karma

jinishshah
Explorer

Thanks for your quick reply @ITWhisperer . Merging for Type=Autosys is working fine but not for others. I am getting blank output in others. What if I change <blank> in Mapping.csv to "all". What will be the query then ?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| inputlookup Horizon.csv
| eval Name=if(Type="Autosys",GRN,"all")
| lookup Mapping.csv Type Name
0 Karma

jinishshah
Explorer

Hey @ITWhisperer , it worked for Module column but not working as expected for Header column. Picking up wrong value

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In what way is it wrong? What are you getting? What are you expecting?

0 Karma

jinishshah
Explorer

Sorry My Bad.....Its works Superbly !!! Thanks for your quick answer !!! Really appreciated !!

ITWhisperer
SplunkTrust
SplunkTrust

Assuming <blank> fields are blank string and not null, try something like this

| inputlookup Horizon.csv
| eval Name=if(Type="Autosys",GRN,"")
| lookup Mapping.csv Type Name
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...