Splunk Search

[Help] Renaming field of a specific source

Zyon
Engager

Hi,

I am using multiple sources in a single search command and i want to rename the _raw field of one of the source type.

My current search:

sourcetype="blacklisted ip" OR sourcetype="log" | rename _raw as blacklisted

I want to change the _raw field of blacklisted ip into blacklisted, and leave the _raw field of log as default.

Thanks a lot.

Tags (1)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee
sourcetype="a" OR sourcetype="b" | eval blacklisted=if(sourcetype=="a",_raw,null())

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee
sourcetype="a" OR sourcetype="b" | eval blacklisted=if(sourcetype=="a",_raw,null())

linu1988
Champion

If you want to get rid of the data of the specific sourcetype please use the transforms.conf file to null queue... And yes you can rename the _raw field as well, but its temporary.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...