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!

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