Splunk Search

Could someone provide regex help?

tkerr1357
Path Finder

Hey all , 

just need a little regex help trying to pull an IP address out  and its not working.

here is my rex 

| rex field=_raw "Remote host:(?<Remotehost>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"

here is an example event 

4/7/22
3:11:32.000 PM
 
04/07/2022 03:11:32 PM LogName=Security EventCode=4779 EventType=0 ComputerName=BPSQCP00S080.rightnetworks.com SourceName=Microsoft Windows security auditing. Type=Information RecordNumber=115076290 Keywords=Audit Success TaskCategory=Other Logon/Logoff Events OpCode=Info Message=A session was disconnected from a Window Station. Subject: Account Name: 705628 Account Domain: RIGHTNETWORKS Logon ID: 0x13887BFB Session: Session Name: RDP-Tcp#81 Additional Information: Client Name: DESKTOP-PIT40LB Client Address: 73.175.205.64
Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your event doesn't have "Remote host:" in it

0 Karma

tkerr1357
Path Finder

sorry sent the wrong rex 

| rex "Client Address:(?<clientaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your event has a space after the colon which isn't in your rex expression.

https://regex101.com/r/EeHQwE/1 

0 Karma

mayurr98
Super Champion

best to use "\s*" instead of "\s" if you are not sure if there will be a space is future events or not.

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