Splunk Search

Rename a field Value in a lookup file?

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

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

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
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!