Splunk Search

Regex help to extract number

splunksogetiht
Explorer

Hello,

My logs contain some sentence like :
"2014-07-22 14:47:10,783 INFO [LoggingInterceptor]|EXIT: CmsXwbDecodingPayloadDriver.decode() : 15ms"

I want to extract the '15' (from '15ms') in a field "decode_time" and display the result for each corresponding event.

I am cleary not confident with regular expressions.

What should I do ?

Thank you

Tags (2)
1 Solution

somesoni2
Revered Legend

Try this

your base search | rex ": (?<decode_time>\d+)ms$"

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Something like this should do the job.

rex "(?<decode_time>\d+)ms$"
---
If this reply helps you, Karma would be appreciated.

somesoni2
Revered Legend

Try this

your base search | rex ": (?<decode_time>\d+)ms$"

splunksogetiht
Explorer

Nice !

Thank you

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