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

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

Try this

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

splunksogetiht
Explorer

Nice !

Thank you

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...