Splunk Search

Get customer ID form logs

bharat149
Explorer

I have a log of the form

"Associated integration for customer AAA is Integration{id=1865, clientID}, carrying out deactivate call while processing message success"

I wanted to extract the AAA which is the customer name from this log 

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

 

| rex field=_raw "Associated integration for customer (?<customer_name>[\w]+)"

 

The statement in the quotes is a regex that is used to match and capture the name as the field customer_name

If the customer name is a sequence of normal A-Z upper/lower case characters the \w is sufficient, however, if there are other characters in the name, then put those character classes inside the [] and add in the extra constraining text after the customer name,

0 Karma
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...