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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...