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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...