Splunk Search

How to do One field extraction for similar sourcetypes?

NoSpaces
Contributor

Hello to everyone.

After reading the post linked down below, I tried to use the same approach for sourcetypes from Windows hosts.

https://community.splunk.com/t5/Splunk-Search/Applying-Field-Extractions-to-Several-Sourcetypes/m-p/...

To do it I used this regex like a sourcetype:
(?::){0}*WinEventLog

But it didn't work, and I think that I misunderstood something.
Is anyone able to explain to me what was wrong?

 

Labels (2)
0 Karma
1 Solution

isoutamo
SplunkTrust
SplunkTrust

Hi

I think that your "regex" should be 

(?::){0}WinEventLog*

as the changing part is in the end of ST name.

r. Ismo 

View solution in original post

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

I think that your "regex" should be 

(?::){0}WinEventLog*

as the changing part is in the end of ST name.

r. Ismo 

0 Karma

NoSpaces
Contributor

Thank you for your answer
I tried this one before posting the question, but it didn't work
Now, after I removed another extraction rules for each sourcetype, I decided to give it one more try
And now it's working as expected
I feel myself like dumm but happy 😃

0 Karma

NoSpaces
Contributor

Up

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What is your usecase (it could be that the other post does not apply for you)?

0 Karma

NoSpaces
Contributor

All sourcetypes from Windows EventLog start with "WinEventLog".
For example:

  • WinEventLog:Security
  • WinEventLog:System
  • WinEventLog:Application 
  • WinEventLog:Microsoft-Windows-WindowsUpdateClient/Operational

It isn't necessary to use one extraction rule instead of per sourcetype because there aren't many different Windows sourcetypes in our production.
But I think that it's more convenient for me.

In my usecase I want to extract the Severity field, which I use for log coloring (global eventtype rule)
Below, you can see an example of a specific sourcetype:

[WinEventLog:Application]
EXTRACT-Severity = \sType=(?<Severity>\w+)

 

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...