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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...