Splunk Search

Is there anyway to modify a field name automatically at search time configuring props.conf and transforms.conf?

ryoji_solsys
Explorer

Is there anyway I can modify a field name at search time ?

I have a field "client__phone" (with double underscores) which is dynamically generated based on my regex in transforms.conf as shown below at search time.

[req_transform]
CLEAN_KEYS = 1
REGEX = request\=\"(?<_KEY_1>\w+.+\w+)\:(?<_VAL_1>\w+|\d+)\}\s
MV_ADD = 1

And a sample data is

...request="client:{phone:1234456} receiver:{23404} accesspoint:{Notifier} endpoint:{343} " opn=".....

I would like to append "req" in front of the field and remove an underscore so that it becomes something like "req_client_phone".

I would like to modify the field automatically by editing transforms.conf and props.conf. I know that I can modify the field with "rename"
command but I want to do this "automatically".

Thanks.

1 Solution

richgalloway
SplunkTrust
SplunkTrust

Have you considered creating an alias? Put this in your props.conf file:

FIELDALIAS-clientPhone = phone AS req_client_phone
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Have you considered creating an alias? Put this in your props.conf file:

FIELDALIAS-clientPhone = phone AS req_client_phone
---
If this reply helps you, Karma would be appreciated.

somesoni2
SplunkTrust
SplunkTrust

Generic field alias would be like this

FIELDALIAS-clientfields = client__* as req_client_*
0 Karma

ryoji_solsys
Explorer

Hi richgalloway and somesoni2,

Thanks for the quick reply.
"FIELDALIAS" works for me.
I tried using wildcard as somesoni2 suggested but it's not working for me.
I wonder if "FIELDALIAS" doesn't support wildcard.

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