Splunk Search

rex

rkris
Explorer

I'm trying to extract this line from my linux logs in splunk using rex  but I'm not sure how to extract it

TCP 191.174.4.187:80 -> 10.10.50.26:100

Labels (2)
0 Karma

arjunpkishore5
Motivator

Can you post a sample of your raw data line and what you need extracted? for your question, it isn't clear, if you want one variable to extract the entire phrase or if you want to extract fields from the pasted line.

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

 

You could try this:

index=_internal
| head 1
| eval _raw="TCP 191.174.4.187:80 -> 10.10.50.26:100"
| rex "TCP\s+(?<src>[^:]+):(?<src_port>[^\s]+)\s+->\s+(?<dst>[^:]+):(?<dst_port>[^\s]+)"

Get Updates on the Splunk Community!

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

&#x1f342; Fall into November with a fresh lineup of Community Office Hours, Tech Talks, and Webinars we’ve ...

Transform your security operations with Splunk Enterprise Security

Hi Splunk Community, Splunk Platform has set a great foundation for your security operations. With the ...

Splunk Admins and App Developers | Earn a $35 gift card!

Splunk, in collaboration with ESG (Enterprise Strategy Group) by TechTarget, is excited to announce a ...