Splunk Search

How to extract value under double quotes using the rex command?

saravanafd
Explorer

Has been busy for "639" seconds

using rex command i need to extract value 639 and store it in one field.

Please help !!!

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try this:

... | rex "busy for \"(?<one>\d+)" | ...
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

vnravikumar
Champion

Hi

Try this

| makeresults 
| eval msg ="busy for \"639\" seconds" 
| rex field=msg "\"(?P<seconds>[\d]+)\""
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this:

... | rex "busy for \"(?<one>\d+)" | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

saravanafd
Explorer

Thank you very much for the resolution. Works perfectly 🙂

0 Karma
Get Updates on the Splunk Community!

Splunk App for Anomaly Detection End of Life Announcment

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...