Refine your search:

Hi,

I would like to rewrite bogus field values that are negative to 0. For example I would like to run the following search and plot a timechart of all 3 values, but change any that are negative to 0.

timechart max(mms_run_time_hour) as "MMS Run Time" max(vfn_run_time_hour) as "VFN Run Time" max(sms_run_time_hour)

Thanks

asked 17 Jul '10, 01:40

mcwomble's gravatar image

mcwomble
87111
accept rate: 0%

edited 11 Jun '11, 19:35

dwaddle's gravatar image

dwaddle ♦
15.5k2924


One Answer:

You can use an eval search command like this:

... | eval bogus_field=if(bogus_field>0, bogus_field, 0)

Or, perhaps even better:

... | eval bogus_field=max(bogus_field,0)
link

answered 17 Jul '10, 02:44

Lowell's gravatar image

Lowell ♦
11.1k91289
accept rate: 41%

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:

×267
×240

Asked: 17 Jul '10, 01:40

Seen: 1,133 times

Last updated: 11 Jun '11, 19:35

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