Splunk Search

REGEX field at index time - transforms.conf

aszczudlo
Engager

hi,
I'm trying to prepare output at the index time for IIS logs and cs_username which for now contains prefix that I DO NOT want.

cs_username = "0#.w|domain\username"
I want to have that field witouth prefix
cs_username = "domain\username"

Sometimes this cs_username value that is correct "domain\username"

How I move this
|rex field=cs_username "(0#.w|(?.)|(?.))"
to work in transforms.conf and at best to extract value in same field (just overvrite cs_username)
or at least to the same like is in example user1 and user2

Tags (1)
0 Karma

aszczudlo
Engager

correction... working version is: |rex field=cs_username "(0#.w|(?<\user1>.)|(?<\user2>.))"

  • I had to add "\" in front of user1 and user2 in order to get correct formating
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...