Splunk Search

How to extract event_id and STATUS?

jayakumar89
Explorer

I have a single row event that populates the below values and i would like to extract eventid=389643 and STATUS=FINISHED using regex. Could you help me with the regex pattern to extract these values.

2017-10-30 06:48:03,357 [pool-22-thread-1] INFO xxxxxxxxxxxxxxxxxxxxxxx - Email Sent
To : xxxxxxxxxxxxxxxxxxxxxxxx
From : xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject : Plan Status - 389643 FINISHED
Body : Plan Status - 389643 FINISHED

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Try this

| rex Status\s\-\s(?<eventid>\d+)

| rex -\s\d+\s(?<STATUS>\w+)

s2_splunk
Splunk Employee
Splunk Employee

Try this: <yoursearch> | rex field=_raw "(?<eventID>\d+)\s(?<STATUS>\w+)$"

This assumes that there is nothing in the event after your status value (the RegEx anchors to the end of _raw)

cpetterborg
SplunkTrust
SplunkTrust
... | rex "Subject : Plan Status - (?<eventID>\d+)\s(?<STATUS>\w+)"

will work if you have additional stuff after that last line.

0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...