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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...