How many days in this month?

 | makeresults 
 | eval days_in_month=mvindex(split(if(tonumber(strftime(_time,"%y"))%4=0,"31,29,31,30,31,30,31,31,30,31,30,31","31,28,31,30,31,30,31,31,30,31,30,31"),","),tonumber(strftime(_time,"%m"))-1)


Given _time how many days are in this month, 31? 30? 28? 29? This eval statement uses a lookup held in a multi-value array to pull out the value in a computationally efficient manor.



The eval expression is the solution, and the example only uses makeresults to fake create sample data