Splunk Enterprise Security

Extracting values from a field

moayadalghamdi
Path Finder

Hello Splunker

 

usernames in my environment are shown as  :

user=Company\username@AD#

 

where the # is a number

and some users are shown as:

user=Company\username$@AD#

 

the username has many variations"

  • only numbers
  • only letters
  • combination of both

 

i want to extract only the username with the other letters

 

thanks ^_^

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Something like this?

| makeresults 
| eval _raw="user=Company\\username$@AD#
user=Company\\username@AD#"
| multikv noheader=t
| fields _raw



| rex "\\\(?<username>.+?)\$?\@"

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Something like this?

| makeresults 
| eval _raw="user=Company\\username$@AD#
user=Company\\username@AD#"
| multikv noheader=t
| fields _raw



| rex "\\\(?<username>.+?)\$?\@"

moayadalghamdi
Path Finder

sir you're a legend, thanks ^_^

 

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...