Splunk Search

Adding one more field to a sub-search.

cheukkay
Engager

Hey guys ,

I have created a subsearch for my firewall log files :

sourcetype="honetnet" [search sourcetype ="honetnet" | top limit=10 SPT | fields SPT] |top limit=3 SRC BY SPT

The results i get is what i wanted , whereby i search for the top 10 SPT(Source ports) and then search for the top 3 SRC(source ip address) for each source port. However , I would like to add one more field(direction) to show the direction of my connection to my search but I am having difficulties.

Current output :
SPT , SRC ,count , percent

New output:
SPT,SRC,direction,count,percent

Any ideas? Thanks alot!

0 Karma

emaccaferri
Communicator

You can try with (instead of top)

 | stats SRC, duration by SPT | sort - count | head 3
Get Updates on the Splunk Community!

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

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...