Splunk Search

Removing ports utilizing "between" X and Y

Hegemon76
Communicator

Hello,

I am trying to use a "between" function. For instance:

index=main sourcetype=":cisco_asa" | where dest_port > 1024 AND dest_port!= 8000-8999 etc etc

Obviously "8000-8999" does not work. Any help would be appreciated.

Thank You,

Tim

0 Karma
1 Solution

elliotproebstel
Champion

The way to search for dest_port!=8000-8999 would be to split it like this: dest_port<8000 OR dest_port>8999. Also, you don't need to push that into a where clause; it can (and should) go directly into your base search for better efficiency:

index=main sourcetype=":cisco_asa" dest_port > 1024 AND (dest_port<8000 OR dest_port>8999)

View solution in original post

elliotproebstel
Champion

The way to search for dest_port!=8000-8999 would be to split it like this: dest_port<8000 OR dest_port>8999. Also, you don't need to push that into a where clause; it can (and should) go directly into your base search for better efficiency:

index=main sourcetype=":cisco_asa" dest_port > 1024 AND (dest_port<8000 OR dest_port>8999)

Hegemon76
Communicator

Perfect!

Thanks!

0 Karma

ppablo
Retired

Hi @Hegemon76

Glad you found your answer through the awesome @elliotproebstel 🙂 Please don't forget to resolve your question by clicking "Accept" directly below his answer. This will make the solution easier to find for others who have the same question. Also, upvoting posts by the users who help you out is always encouraged.

Thanks!

0 Karma

Hegemon76
Communicator

Done and Done

ppablo
Retired

Thank you!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...