Splunk Search

How can I extract this string from a value in my sample log?

rakeshkumar_sah
New Member

Hi,

I have logs followed with a structure like this:

start Performance Logging: [txID=123456789-EJBClientf123456789-EJBServerf12456789;funtion=getClientValue]

How can I extract the EJBServerf12356789 values from txID?

Thanks for the response.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Rex can do the job. The following will break the txID field into three parts which you can then process.

... | rex field=txID "(?P<txID1>.*)-(?P<txID2>.*)-(?P<txID3>[^;]*)" | ...
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...