All Apps and Add-ons

How to configure additional extractions on the "Message" field based on EventCode for WindowsEvent?

junxianli
Explorer

Hi all,

I am trying to source a way to only perform a certain set of extractions on the "Message" field, when EventCode=4265 (e.g).

Anyone has any clue? I don't want to apply the extraction directly on each event, as it may cause performance issue.

0 Karma

aakwah
Builder

Hello,

you can do the following

index=windows_events EventCode=4265 | rex "your_regex"

you can use erex to help you in building regex as per the following

index=windows_events EventCode=4265 | erex Message examples="error,login"

Regards,
Ahmed

0 Karma

aakwah
Builder

Yes that can be done, run the query on search

index=windows_events EventCode=4265

Then at the bottom of Fields bar (on left down corner of web interface)
press Extract New Fields
select any sample event
click Next
mark 4265 # the value of Event code we want to add to the regex
a menu will appear, select Require, then Add Required Text
mark the part pf the message you want to extract
a menu will appear, select Extract, provide Field Name, then Add Extraction
click Next
validate results
save

The generated regex will be added to props.conf

Regards,
Ahmed

0 Karma

junxianli
Explorer

Any ways to perform it via props.conf, transforms.conf or other .confs, instead of doing it within the search string?

0 Karma
Get Updates on the Splunk Community!

New Case Study Shows the Value of Partnering with Splunk Academic Alliance

The University of Nevada, Las Vegas (UNLV) is another premier research institution helping to shape the next ...

How to Monitor Google Kubernetes Engine (GKE)

We’ve looked at how to integrate Kubernetes environments with Splunk Observability Cloud, but what about ...

Index This | How can you make 45 using only 4?

October 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...