If you are using CASE, then you never need to test for the opposite of a prior test. For example, with the first test being $start_time$=="ZERO_TIME", you don't need to ever test for$start_time$!="ZERO_TIME" in all the rest after that. Also, for each "less than x", you never have to test to make sure it's greater than that. So, for the first version of the code, the code simplifies to a much more readable version that looks something like this -
[crange(1)]
args = start_time
eval duration=IF( $start_time$=="ZERO_TIME",-1, now() - strptime($start_time$, "%a %b %d %H:%M:%S %Y"))
|
eval range=case(duration < 0,"All Time",
duration = 0,"Instant",
duration <= 300, "5 Minutes",
duration <= 900, "15 Minutes",
duration <= 3600, "1 Hour",
duration <= 14400,"4 Hours",
duration <= 86400, "1 Day",
duration <= 3888000, "1-45 Days",
duration > 3888000, "45 Days +" )
... View more