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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

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 ...