Refine your search:

Hey everyone. I am trying to create a dashboard; one of the primary items we're looking to create is a composite score of a number of metrics. Basically if item A is below a certain level it is rated 0, if its above a certain level it is rated 1. This is done for a number of items. The items are then totalled, and divided by the number of items to give us an average. How can I do the branch logic in eval statements? Is it possible?

asked 20 Dec '10, 21:04

msarro's gravatar image

msarro
5773437
accept rate: 75%


One Answer:

There is an if() eval function:

... | eval rating=if(A < level , 0, 1) | ...
link

answered 20 Dec '10, 22:27

gkanapathy's gravatar image

gkanapathy ♦
32.6k4827
accept rate: 41%

Thanks! I actually found it after some searching. Very much appreciated :)

(21 Dec '10, 01:26) msarro
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:

×31

Asked: 20 Dec '10, 21:04

Seen: 711 times

Last updated: 20 Dec '10, 22:27

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