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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

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