Splunk Search

How to create a rex for search?

super_virus
New Member

I have the below log line:
Slow GraphQL query [8447ms]

How can I grab only the value "8447"?

Tags (2)
0 Karma

cpetterborg
SplunkTrust
SplunkTrust

Search-time? Index-time? Are all the events similar? Is that the whole event?

If you just want a search-time rex way with the example data being the whole event:

... | rex "\[(?P<ms>\d+)ms\]"

If it isn't the entire event, then use the field=yourfieldname option to the rex command.

0 Karma

PowerPacked
Builder

Hi

Please find the following imagealt text

0 Karma
Get Updates on the Splunk Community!

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What’s New & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...