Splunk Search

How do you extract a new field from a source field?

pbsuju
Explorer

I have a log with below as a source field from which I need to extract the field Gateway name (My_Gateway_NONPROD).

Any help in how to extract it?.

source= /apps/geneos/gateway/logs/My_Gateway_NONPROD.log
0 Karma
1 Solution

chrisyounger
SplunkTrust
SplunkTrust

hi @pbsuju

Give this a try : | rex field=source ".*\/(?<gateway_name>[^\.]*)" | table gateway_name

All the best!

View solution in original post

chrisyounger
SplunkTrust
SplunkTrust

hi @pbsuju

Give this a try : | rex field=source ".*\/(?<gateway_name>[^\.]*)" | table gateway_name

All the best!

pbsuju
Explorer

Great thanks. It worked

0 Karma

chrisyounger
SplunkTrust
SplunkTrust

Great! Thanks for accepting 🙂

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