Splunk Search

Have Multiple REGEX in Transforms

Scarecrowddb
Explorer

Hi All,

I was wondering how you go about sending different criteria to the null que and whether the below would work?

----tranforms.conf----

[WindowsLogonEvent675]
REGEX = (?msi)EventCode=4624.Account Name:\s(-)
REGEX = (?msi)^EventCode=(632|4719|4728|4729|4670)
DEST_KEY = _TCP_ROUTING
FORMAT = forwardauqldrv00mgt1ai

Or should the be done like below (with the same [xxxxx]?

----tranforms.conf----

[WindowsLogonEvent675]
REGEX = (?msi)EventCode=4624.Account Name:\s(-)
DEST_KEY = _TCP_ROUTING
FORMAT = forwardauqldrv00mgt1ai

----tranforms.conf----

[WindowsLogonEvent675]
REGEX = (?msi)^EventCode=(632|4719|4728|4729|4670)
DEST_KEY = _TCP_ROUTING
FORMAT = forwardauqldrv00mgt1ai

Sorry for the vague question.... but I hope someone understands what I mean...

Thanks

David

1 Solution

hulahoop
Splunk Employee
Splunk Employee

You cannot have multiple REGEX parameters in transforms.conf for the same stanza. You almost have it correct with breaking this into 2 transforms, but they need to have unique names. So here's how you would split into 2 and call them from props.conf

-----props.conf-----

[mysourcetype]
TRANSFORMS-foo = WindowsLogonEvent675_Part1, WindowsLogonEvent675_Part2

-----transforms.conf-----

WindowsLogonEvent675_Part1]
REGEX = (?msi)EventCode=4624.Account Name:\s(-)
DEST_KEY = _TCP_ROUTING
FORMAT = forwardauqldrv00mgt1ai

[WindowsLogonEvent675_Part2]
REGEX = (?msi)^EventCode=(632|4719|4728|4729|4670)
DEST_KEY = _TCP_ROUTING
FORMAT = forwardauqldrv00mgt1ai

View solution in original post

hulahoop
Splunk Employee
Splunk Employee

You cannot have multiple REGEX parameters in transforms.conf for the same stanza. You almost have it correct with breaking this into 2 transforms, but they need to have unique names. So here's how you would split into 2 and call them from props.conf

-----props.conf-----

[mysourcetype]
TRANSFORMS-foo = WindowsLogonEvent675_Part1, WindowsLogonEvent675_Part2

-----transforms.conf-----

WindowsLogonEvent675_Part1]
REGEX = (?msi)EventCode=4624.Account Name:\s(-)
DEST_KEY = _TCP_ROUTING
FORMAT = forwardauqldrv00mgt1ai

[WindowsLogonEvent675_Part2]
REGEX = (?msi)^EventCode=(632|4719|4728|4729|4670)
DEST_KEY = _TCP_ROUTING
FORMAT = forwardauqldrv00mgt1ai

Scarecrowddb
Explorer

OK, thanks heaps for your help!

0 Karma
Get Updates on the Splunk Community!

.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 ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...