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!

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