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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...