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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...