Splunk Search

Help with Regx extraction

LizAndy123
Path Finder

Hi

I have a Index and in the results on one line I have the following

 

Check Authorization : User1, PROJECT_1_1

I need to extract the User and then another Filer for the Project Name.

Any help would be great

Labels (2)
0 Karma

nachimistry
Path Finder

If the user field comes back as a single character, here's a version anchored on the label:

| rex "Check Authorization\s*:\s*(?<user>[^,]+),\s*(?<project>\S+)"

For `Check Authorization : User1, PROJECT_1_1` that gives user=User1 and project=PROJECT_1_1.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this:

| rex ": (?<User>[^,]),(?<Project_Name>.*)"
---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Kubernetes Alerts That Work Out of the Box with AutoDetect detectors in Splunk ...

A deployment rolls out slowly, one pod sits not ready for a few minutes, and whoever is on call gets an alert ...

Observability at Your Fingertips Directly From Splunk Platform—for Free

At .conf, we announced our roadmap to bring observability foundations to Splunk Platform. Bringing metrics and ...