Splunk Search

Multiple REX from single search

MasterOogway
Communicator

I have some sendmail logs that send the following different entries within the data streams:

disposition=abc123

disposition=abc123, followed by some stuff.

disposition=xyz-123

disposition=xyz-123, followed by some stuff.

And I need to build one REX statement that allows me to call what comes after the "=" sign an errorcode. How can define multiple REX's from one search string?

Here is an example that works, but also pulls too much information after location the errorcode.

index=sendmail | rex "disposition=(?.*?)$" < ---sorry, the editor won't define my angle bracket, word, angle bracket that is between the first ? and the second?

It pulls everything after the errorcode including addtional characters, words and numbers and I need to grab strong text only.

Any thoughts on how to build a multi REX statement within one search query and defining each found errorcode as an incident?

Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Perhaps something like "disposition=(?P[^\n,]*),?" will help.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Perhaps something like "disposition=(?P[^\n,]*),?" will help.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...