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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...