Splunk Search

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

dbashyam
Explorer

Hi,

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.

Thanks,
Dinesh

Tags (1)
0 Karma

grijhwani
Motivator

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

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

Regards,
Christian

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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