Splunk Search

Need help in lookups

shiva_kolachala
Engager

Hi,

I am having trouble using lookups. I have four fields in a csv file error_code,criticality, service,service_type,Info

My events in logs have fields extracted error_code,service,service_type. Now my reqirement is if an error_code with specific service and service_type should print that particular Info.

I tried this query:
sourcetype="lookup-test" | stats count by error_code,service,service_type,buis_proc | lookup error_code error_code as error_code service as service service_type as service_type OUTPUT Info as description.

But I am unable to get the description for all the entries. Please help

error_code service service_type buis_proc count description

1 100 CARDSERVICES RED STATUS_UPDATE 1 contactRED

2 101 WALLET LEDGER BALANCE_ENQUIRY 1

3 200 CARDSERVICES VISA STATUS_UPDATE 1

4 201 CARDSERVICES RBS STATUS_UPDATE 1 contactRBS

5 202 WALLET LEDGER BALANCE_ENQUIRY 1

6 203 CARDSERVICES NUCLEUS STATUS_UPDATE 1

7 205 CARDSERVICES GANDD STATUS_UPDATE 1

8 206 WALLET LEDGER BALANCE_ENQUIRY 1

9 207 CARDSERVICES VISA STATUS_UPDATE 1

10 300 WALLET LEDGER BALANCE_ENQUIRY 1

Tags (2)
0 Karma
1 Solution

_d_
Splunk Employee
Splunk Employee

Try this a let us know what the result is? (I am assuming that you have defined the lookup in your transforms.conf and the stanza name is error_code)

sourcetype="lookup-test" | stats count by error_code,service,service_type,buis_proc | lookup error_code error_code service service_type OUTPUT Info

View solution in original post

0 Karma

_d_
Splunk Employee
Splunk Employee

Try this a let us know what the result is? (I am assuming that you have defined the lookup in your transforms.conf and the stanza name is error_code)

sourcetype="lookup-test" | stats count by error_code,service,service_type,buis_proc | lookup error_code error_code service service_type OUTPUT Info

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!

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Introducing the 2026 - 2027 SplunkTrust cohort!

The goal of the SplunkTrust™ membership has historically been to acknowledge and recognize those who go above ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...