Splunk Search

Help with rex expression to capture time

xvxt006
Contributor

Hi,

i have an event like below after ms there is a line break and some other text.
i want to capture that time. i have tried the below expression but it did not work. Any suggestions?

INFO: Server will startup in 2131 ms
sdfsfsdfsdfsff

expression i have used: rex field=_raw "(?i) .? Server will startup in (?P.?)(?=ms)"

Tags (1)
0 Karma
1 Solution

sbrant_splunk
Splunk Employee
Splunk Employee

Just needed a slight adjustment to your regex:

(?P<fieldname>\d+)(?=\sms)

View solution in original post

xvxt006
Contributor

Thx for the input. i have tried the other solution and it worked.

0 Karma

strive
Influencer

INFO: Server will startup in (.*)

I tried it in pythex and it worked

0 Karma

sbrant_splunk
Splunk Employee
Splunk Employee

Just needed a slight adjustment to your regex:

(?P<fieldname>\d+)(?=\sms)

xvxt006
Contributor

Thx. This worked

0 Karma
Get Updates on the Splunk Community!

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...

Enterprise Security Content Update (ESCU) | New Releases

In April, the Splunk Threat Research Team had 2 releases of new security content via the Enterprise Security ...