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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...