I am creating a series of dashboards with will enable to globally view data and drilldown to specific events.
My first dashboard is the percentage of uptime of all my services in Nagios. My search is as follows:
index=nagios-availability
| timechart span=1mon limit=100 eval(round(avg(uptimepercentage),3)) by servicename
| eval Time=strftime(_time,"%B %Y")
| table Time,*
| fields - _time
I am modifying the _time because I want to see the MONTH and YEAR (like MARCH 2014) in order for it to be more user friendly. I have created a drilldown from this dashboard to another form to allow users to click in a specific cell and have uptime information regarding that month (by day) appear in another dashboard.
<drilldown>
<link>
/app/SplunkForNagios/service-availability-month? form.theservicename=$click.name2$&form.monthYear=$click.value$
</link>
</drilldown>
This is the search in my second dashboard which I would like to show the average availability by day in that specific month. Here is the search I have so far:
index="nagios-availability" servicename="$theservicename$" | timechart span=1day limit=100 eval(round(avg(uptimepercentage),3)) by servicename
The problem is that I don't know how to tell this search to snap to the beginning of the month and year that I am passing as a parameter. I have tried a couple things with no luck.
Any ideas ??
Thanks
Try this a your second search.
index="nagios-availability" servicename="$theservicename$"
[|stats count | eval earliest=strptime("01 "."$monthYear$","%d %B %Y") | eval latest=relative_time(earliest,"+1mon@mon") | table earliest latest | format "" "" "" "" "" ""]
| timechart span=1day limit=100 eval(round(avg(uptimepercentage),3)) by servicename
Try this a your second search.
index="nagios-availability" servicename="$theservicename$"
[|stats count | eval earliest=strptime("01 "."$monthYear$","%d %B %Y") | eval latest=relative_time(earliest,"+1mon@mon") | table earliest latest | format "" "" "" "" "" ""]
| timechart span=1day limit=100 eval(round(avg(uptimepercentage),3)) by servicename
This did in fact work. Thank You