Splunk Search

Rename a field Value in a lookup file?

iamsplunker31
Path Finder

I have a lookup file called template.csv and it has field values, I want to rename a field value with another say mango to banana. how can we do ?

Also If I want to replace the field values in 2 lookupfiles in template.csv and template2.csv rename field value with mango to banana .Can we do in one query?

0 Karma
1 Solution

darrenfuller
Contributor

To replace all values in fieldname from mango to banana, use something like:

| inputlookup template.csv
| eval fieldname=if(fieldname="mango", "banana", fieldname)
| outputlookup template.csv

and no... you would need to do this in two queries.

View solution in original post

0 Karma

darrenfuller
Contributor

To replace all values in fieldname from mango to banana, use something like:

| inputlookup template.csv
| eval fieldname=if(fieldname="mango", "banana", fieldname)
| outputlookup template.csv

and no... you would need to do this in two queries.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...