Splunk Search

regex to find domain\account

zaynaly
Explorer

This is the regex I have, though not finding anything..:

|rex "(?<account>\w{2,6}\\.{3,15})"

example of domain and usernames:
bla\johnny99
tstbla\wawster
ble\kd0493487

Tags (2)
0 Karma

mayurr98
Super Champion

hey Try this run anywhere search

| makeresults 
| eval raw="bla\johnny99 tstbla\wawster ble\kd0493487" 
| makemv raw
| mvexpand raw
| rex field=raw "(?<domain>\w{2,6})\\\\(?<account>.{3,15})"

In your environment, you shuld try

<your_base_saerch> 
| rex field=_raw "(?<domain>\w{2,6})\\\\(?<account>.{3,15})"

let me know if this helps!

0 Karma

somesoni2
Revered Legend

Try this

|rex "(?<account>\w{2,6}\\\\.{3,15})"
0 Karma

gokadroid
Motivator

Lets say you already have this combined information (xxxxxx\yyyyyy) in a field call data then you can try this:

your query to return field data
| rex field=data "(?<firstPart>[^\\]+)\\(?<secondPart>.*)"
| table firstPart, secondPart

where
Field firstPart is everything before a \
Field secondPart is everything after a \

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...