Splunk Search

splunk search to find who (ip's) connects to port 9997



I am looking for a splunk search to find which IP's are connecting to port 9997?

index=sys_*prod source=netstat | search State='ESTABLISHED' and LocalAddress=':9997'

I tried but I am not getting the proper result. Any idea how I can get the result.


Tags (1)
0 Karma


Presumably your "LocalAddress" field is a complete address, not just the port number, in which case the term "LocalAddress=':9997'" is never going to be satisfied. At the very least it will need to be LocalAddress="*:9997". Firstly you are using single quotes, which mean the parameter is taken to be absolutely literal (i.e. no string matching patterns), and secondly you will need to match the trailing address (hence the leading asterisk).

0 Karma

Path Finder

Hi Dinesh,

maybe you could give us a sample out of your logs.
With the current information I would suggest the following search query:

   index=sys_*prod source=netstat State='ESTABLISHED' LocalAddress=':9997' | stats values(src_ip_field)

Remember field names are case-sensitive, a AND connection was done implicit and if needed has to be written upper-case.


0 Karma
Get Updates on the Splunk Community!

Infographic provides the TL;DR for the 2023 Splunk Career Impact Report

We’ve been shouting it from the rooftops! The findings from the 2023 Splunk Career Impact Report showing that ...

Splunk Lantern | Getting Started with Edge Processor, Machine Learning Toolkit ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...