All Apps and Add-ons

How to write regex for sourceip and des ip?

agnes1015
New Member

how to separate source and destination ips on firewall statement such as below:

date time firewall: access-list network_in permitted udp source/d.d.d.d(p) -> des/d.d.d.d(p) hit-cnt 1 first hit

Tags (2)
0 Karma
1 Solution

musskopf
Builder

You can start like this:

.+source\/(?P<source_ip>(\d{1,3}\.){3}\d{1,3})\((?P<source_port>\d+)\) -> des\/(?P<des_ip>(\d{1,3}\.){3}\d{1,3})\((?P<des_port>\d+)\)

I used some very simple expression to match the IP, feel free to change it... I also identified the port, if you wish to use

View solution in original post

0 Karma

agnes1015
New Member

it works!!! super thanks! 😄

0 Karma

musskopf
Builder

You can start like this:

.+source\/(?P<source_ip>(\d{1,3}\.){3}\d{1,3})\((?P<source_port>\d+)\) -> des\/(?P<des_ip>(\d{1,3}\.){3}\d{1,3})\((?P<des_port>\d+)\)

I used some very simple expression to match the IP, feel free to change it... I also identified the port, if you wish to use

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...