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!

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...

Ready, Set, SOAR: How Utility Apps Can Up Level Your Playbooks!

 WATCH NOW Powering your capabilities has never been so easy with ready-made Splunk® SOAR Utility Apps. Parse ...

DevSecOps: Why You Should Care and How To Get Started

 WATCH NOW In this Tech Talk we will talk about what people mean by DevSecOps and deep dive into the different ...