Splunk Search

Populating Additional Information on Field Data

chrisschum
Path Finder

I'm getting log data from a system that uses codes for each entry and I'd like to replace or add a description of the code to my results. There's a big list of codes for the system so I was wondering how I can do that.

Example:
The system logs that User A performed Code A on a user account
The system logs that User B performed Code B on a user account

Code A = User password change
Code B = User address change

Expected results in Splunk search:
User A performed Code A "User password change"
User B performed Code B "User address change"

Thanks!

Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

This is what lookups are for. Create a CSV file ("codes.csv") with your codes and descriptions like this:

Code, Description
A, User password change
B, User address change

Then use the lookup command to get the description from the file at search time.

<your base search> | lookup codes.csv Code OUTPUT Description | table User Code Description
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This is what lookups are for. Create a CSV file ("codes.csv") with your codes and descriptions like this:

Code, Description
A, User password change
B, User address change

Then use the lookup command to get the description from the file at search time.

<your base search> | lookup codes.csv Code OUTPUT Description | table User Code Description
---
If this reply helps you, Karma would be appreciated.
0 Karma

chrisschum
Path Finder

Perfect! Thanks!

0 Karma

chrisschum
Path Finder

Also, it may not have been clear above but I would like to have a list of the codes and their values and have that list checked when a search is done so that a description of the code populates in the search.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...