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
Revered Legend

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!

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