Splunk Search

Extract 'table structured' data from log file using Perl.

A3gupta
New Member

I have a log file in a table structured form like this,

Code send_id dest_id

AW 96 45

BX 65 78

Now here I have to change that send_id column id's to the name(like 96 = Alex and 65= James) and regenerate the log file like the below format.

Code send_id dest_id

AW Alex 45

BX James 78

How do I extract it and again regenerate it after changing?

Labels (3)
0 Karma

thambisetty
SplunkTrust
SplunkTrust

you can replace send_ids with name as you described, but this would be pain for you if there are high number of IDs for which you want to translate.

Scenario 1 : you can convert them using Search Processing Language.

| your search and add below search to your search
| eval send_id=case(send_id=="96","Alex",send_id=="65","James")

 Scenario 2: where you can make use of Splunk knowledge objects - Lookups

I have made a video on how to use Lookups, you can find it useful.

https://www.youtube.com/watch?v=cwEzgY0lAts&t=456s

————————————
If this helps, give a like below.
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!

Mile High Learning with Splunk University, Denver, Colorado

If Denver is known for its mile-high elevation, Splunk University is about to raise the bar on technical ...

IT Service Intelligence 5.0 Series: Your Guide to the June Launch

We are excited to announce the June release of Splunk IT Service Intelligence (ITSI) 5.0. This update ...

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...