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!

Customer Experience | Splunk 2024: New Onboarding Resources

In 2023, we were routinely reminded that the digital world is ever-evolving and susceptible to new ...

Celebrate CX Day with Splunk: Take our interactive quiz, join our LinkedIn Live ...

Today and every day, Splunk celebrates the importance of customer experience throughout our product, ...

How to Get Started with Splunk Data Management Pipeline Builders (Edge Processor & ...

If you want to gain full control over your growing data volumes, check out Splunk’s Data Management pipeline ...