Splunk Search

Field Extraction - same field from different log events

jbuhrmann
Engager

I have a firewall log search returning two different types of events but I'm trying to capture the source ip address from both. The events look like:
Deny inbound icmp src inside:172.22.15.90 ...
Inbound TCP connection denied from 172.22.15.90/53340 ...

The Field Extraction tool comes up with one or the other:
(?i) src inside:(?P[^/ ]+)
(?i) denied from (?P[^/ ]+)

Is there a way to combine the two regex statements into a single which will return a field called src_ip_inside for either event?

Tags (3)
0 Karma
1 Solution

Damien_Dallimor
Ultra Champion

Try something like :

... | rex field=_raw "(?i)(?:src inside:|denied from )(?<src_ip_inside>[^/ ]+)" | table src_ip_inside

View solution in original post

Damien_Dallimor
Ultra Champion

Try something like :

... | rex field=_raw "(?i)(?:src inside:|denied from )(?<src_ip_inside>[^/ ]+)" | table src_ip_inside

jbuhrmann
Engager

The field extraction worked great. Instead of | table at the end I used: | stats count(src_ip_inside) by src_ip_inside to get a table with each src ip and number of events for that ip. Thanks for the help!

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...