Refine your search:

Hi all,

I would like to evaluate the difference between two events (in theory the events contain completely different data). Let's say I have the following events:

timestap1 81 115 42683 1267 0 0
timestap2 81 107 42683 1267 0 0

the third column corresponds to the field Total_Sent and I want to raise an alert if the field is not growing. How can I do: Toal_Sent1 - Total_Sent2 (in my case 42683 - 42683) and check if the result is greater than 5 ?

Thanks from a splunk newbie

asked 08 Sep '10, 14:40

rootto's gravatar image

rootto
235
accept rate: 0%

edited 08 Sep '10, 15:17

Lowell's gravatar image

Lowell ♦
11.1k81289


One Answer:

Have you tried the "delta" search operator?

http://www.splunk.com/base/Documentation/latest/SearchReference/Delta

Delta will find the different between the same extracted field in consecutive events. You will probably need to define field extractions for your fields in order to be able to use delta against them.

link

answered 08 Sep '10, 14:50

dwaddle's gravatar image

dwaddle ♦
15.2k2923
accept rate: 33%

Thanks I implemented it doing

| delta Total_Sent AS diffsent | search diffsent > 5

and it works. Do you know if I can limit the search to the last two events? I tried to pipe | head 2 | but it doesn't help.

Thanks again

(08 Sep '10, 16:35) rootto
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:

×1,642
×395

Asked: 08 Sep '10, 14:40

Seen: 1,408 times

Last updated: 08 Sep '10, 15:17

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