Splunk Search

rex mode sed remove beginning of a string

ecanmaster
Explorer

I have a user field that contains first domain and then followed by user name: Domain\user.name
I want to remove the domain name.
SO everything till \ needs to be removed, so you would only see:
user.name

Tags (1)
0 Karma
1 Solution

HiroshiSatoh
Champion

Try this!

|rex field=your_field mode=sed "s/.*\\\\//g"

View solution in original post

HiroshiSatoh
Champion

Try this!

|rex field=your_field mode=sed "s/.*\\\\//g"

kimikoyan
Explorer

Great answer, solved my problem. Thank you very much for your sharing.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

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