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!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...