Knowledge Management

How to merge a lookuptable with a index

leonardomassard
Explorer

I'm trying to make a join using a lookuptable and a query from a index

alt text

With lookup table
alt text

And the SPL are don't bring the information correct

The commnad that I'm trying to use is

index=cmkprod Service_Name=PING | fields Host_Name, Service_Name, Status | join type=left Host_Name
[ inputlookup compass_ci.csv | fields Host_Name, Region, Ecosystem]
| table Host_Name, Service_Name, Status, Region, Ecosystem

How can I join the lookuptable and a index?

Tags (1)
1 Solution

skoelpin
SplunkTrust
SplunkTrust

No need for inputlookup.. This is a leading command. You're looking for lookup like this

index=cmkprod Service_Name=PING 
| fields Host_Name, Service_Name, Status 
| lookup compass_ci.csv <lookup_column_name> AS <field_name> OUTPUT <column_name>
| fields Host_Name, Region, Ecosystem
| table Host_Name, Service_Name, Status, Region, Ecosystem

You will need to replace the values on line 3 to match your lookup table

View solution in original post

0 Karma

skoelpin
SplunkTrust
SplunkTrust

No need for inputlookup.. This is a leading command. You're looking for lookup like this

index=cmkprod Service_Name=PING 
| fields Host_Name, Service_Name, Status 
| lookup compass_ci.csv <lookup_column_name> AS <field_name> OUTPUT <column_name>
| fields Host_Name, Region, Ecosystem
| table Host_Name, Service_Name, Status, Region, Ecosystem

You will need to replace the values on line 3 to match your lookup table

0 Karma

mayurr98
Super Champion

try this :

index=cmkprod Service_Name=PING 
| lookup compass_cis.csv Host_Name OUTPUT Region Ecosystem 
| table Host_Name, Service_Name, Status, Region, Ecosystem
0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...