Splunk Enterprise

How to filldown with specific field value

Raymond2T
Path Finder

I have the data format below, and I would like to filldown with specific field value base on command Field1.
i.e.  Fill Field2 with character 'B' if Field1 is 'A'

       Fill Filed2 with character 'C' if Field1 is 'B'
Data:

Field1Field2Field3Field4
A fooAbarB
A abcdef
ABghijkl
BCfooBbarC
B aaabbb
B cccddd

 

Change to below format

Field1Field2Field3Field4
ABfooAbarB
ABabcdef
ABghijkl
BCfooBbarC
BCaaabbb
BCcccddd

 

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eventstats values(Field2) as Field2 by Field1

SanjayReddy
SplunkTrust
SplunkTrust

hi @Raymond2T 

Can you plese try this

| eval Field2=if(Field1="A","B",if(Field1="B","C",Field2))

Raymond2T
Path Finder

Thanks for the quick reply.
If I could not hardcode the value , All fields value are search result.
How could I accomplish it ?

Really appreciate for your help.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...