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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...