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
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

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