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!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...