Splunk Search

How to extract text from regular expression "StatusCode_10.178.28.50_1406758126523_19607_10507178"

mvaradarajam
Path Finder

Hi All,

How to extract 10507178 from below string.here all are not constant.but format is same

StatusCode_10.178.28.50_1406758126523_19607_10507178

Tags (1)
0 Karma

somesoni2
Revered Legend

General one to get the last number in the string (after last underscore )

"_(?<YourField>\d+)$"
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Based on that one example, you could use this:

\w+_\d+\.\d+\.\d+\.\d+_\d+_\d+_(<field_name>\d+)
0 Karma
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 ...