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!

New in Splunk Observability Cloud: Automated Archiving for Unused Metrics

Automated Archival is a new capability within Metrics Management; which is a robust usage & cost optimization ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

What's New in Splunk Observability - July 2025

What’s New?  We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what ...