Splunk Search

Rex command for extracting data from a variable

Marco
Communicator

Good Morning,

I am currently trying to extract a field from  a variable.

The variable name is command, and the value the command holds is 

Command = "CONNECT SPLNKUSER GROUP(QA)"

What I'm trying to do is extract the QA part and create a new variable called group.

For example:

Group = QA

Group= Accounting

Group = Payroll

 

Thank you,

Marco

Labels (4)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

This should do it.

| rex field=Command "\((?<group>[^\)]+)"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This should do it.

| rex field=Command "\((?<group>[^\)]+)"
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

New Release | Splunk Cloud Platform 10.1.2507

Hello Splunk Community!We are thrilled to announce the General Availability of Splunk Cloud Platform 10.1.2507 ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

&#x1f5e3; You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...