Splunk Search

please help on how to achieve the below kind of lookup/rename for 100+ fields of my events

smiththebest
New Member

My event log has comma separated field values of 100+ fields. Each field can have about 2-15 different values. Example if field10=3, I need to map to earth, field10=4, map to mars so on. If field11=4, map to blue, field11=5, map to red and so on. Please help with an example format of lookup csv and how to use it in the search bar so the searched events in the output show with the mapped values. thank you

mylookup.csv
.
field1,1=mercury,2=venus,3=earth
field2,1=brown,2=blue,3=red,4=yellow,5=green

my basic search gives
3,2,a,b,c..
how to get output like
earth,blue,x,y,z....
or
3_earth,2_blue,p_x,q_y,r_z....

0 Karma

Anantha123
Communicator

Create 2 lookup tables . One for color (color.csv) and other for Planets (Planets.csv)

Planets.csv will have fields -fields1 , planet
color.csv will have fields - field2, color

base query
| lookup Planets.csv fields1
|lookup color.csv fields2
| table fields1,planet,fields2,color.

0 Karma

smiththebest
New Member

Thank you, my issue is there are about 50 + useful fields out of 250 odd total fields, this means my lookup need to be 50 files. I think it is better to do just replace command in search for the value in fields?

0 Karma

jawaharas
Motivator

What's your basic search? Is your lookup table has headers?

0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Splunk App for Anomaly Detection End of Life Announcement

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...