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!

New in Observability Cloud - Explicit Bucket Histograms

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

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...