I am trying to create a table or timechart that tracks averages for an event from the 3rd Tuesday of every month to the 3rd Monday in the following month (on a reoccurring basis). For example I want the output to look like:
Time Range Average
1/17/12-2/20/12 14.8
2/21/12-3/19/12 15.3
Can someone please help me figure out how to write this query? Thank you for all of your help.
Try this
yoursearchhere |
eval earliest=relative_time(now(),"-2mon@mon") |
eval earliest=relative_time(earliest,"+21d") |
eval earliest=relative_time(earliest, "@w2") |
eval latest = relative_time(earliest,"+28d") |
where _time >= earliest AND _time <= latest |
timechart avg(yourfield)
Good luck! BTW, you realize that if you run this each month, some days will get skipped. Also, you might want to change the second line from "-2mon@min" to "-1mon@mon", depending on when you run the search each month.
Thank you very much for the response. I will try this and let you know how it worked.