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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...