Refine your search:

We have the *NIX app working, and as an example, we have one system feeding netstat and open port data into it. We are feeding this data every hour. How can I send an alert if the reports each hour don't match? Basically, if a new port is opened, or an existing port is closed, we want to get an alert.

Thanks for the help, as always!

asked 03 Nov '11, 10:29

aferone's gravatar image

aferone
15313
accept rate: 100%

edited 03 Nov '11, 10:29


2 Answers:

Try the diff command:

http://docs.splunk.com/Documentation/Splunk/latest/Searchreference/Diff

index=os sourcetype=netstat host=your_host | head 2 | diff
link

answered 03 Nov '11, 13:41

araitz's gravatar image

araitz ♦♦
7.1k2516
accept rate: 38%

Thank you for the answer!

Now, I am trying to create a alert for this. Under normal conditions, I get the " Results are the Same " message. However, when there is a difference, for example, I get this:

@@ -15,3 +15,4 @@ udp 52480 udp 20031 udp 5353 +udp 1514

I am trying to set up the alert so that obviously it only send us an email when there is a difference. I tried using the custom condition in the alert to exclude the " Results are the Same " message, but it is not working.

Any suggestions? Thanks again!

link

answered 04 Nov '11, 10:36

aferone's gravatar image

aferone
15313
accept rate: 100%

I think you can filter no-diffs out by adding one of the following to your search:

... | search linecount > 2
... | search NOT "Results are the Same"
(07 Nov '11, 16:19) araitz ♦♦

This worked perfectly. Thank you!

(09 Nov '11, 08:40) aferone
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×1

Asked: 03 Nov '11, 10:29

Seen: 286 times

Last updated: 09 Nov '11, 08:40

Copyright © 2005-2012 Splunk, Inc. All rights reserved.