Hi,
(I have attached the code I have used as a 'Run anywhere' example.)
WHAT I HAVE
I have a dashboard which initally displays a list of batch jobs,
Batch Job 1
Batch Job 2
Batch Job 3
Batch Job 4
When I click on any of the job names, I want 2 tables to be displayed below it,
Latest Job information, Job statistics
I have managed to make this work by using the logic,
<row>
<panel>
<html>
<a href="?showBatchJob1=true">
<h1>Batch Job 1</h1>
</a>
</html>
</panel>
</row>
<row depends="$showBatchJob1$">
<!---------------------------------------------------
Code to display the two tables
------------------------------------------------------>
</row>
WHAT I NEED:
The problem is, when each of the links are clicked, the entire page is reloaded and the data is taking a long time to load.
Is there a quicker way of doing this?
Thanks,
Deepak
FULL CODE:
<dashboard>
<label>Mockup</label>
<row>
<panel>
<html>
<a href="?showBatchJob1=true">
<h1>Batch Job 1</h1>
</a>
</html>
</panel>
</row>
<row depends="$showBatchJob1$">
<panel>
<title></title>
<table>
<title>Latest Job Information</title>
<search>
<query>index=*
| eval "Last Job ended" ="00:00:00"
| eval "Job Status"="NOT DEFINED"
| eval "Duration per Event" =0
| eval "No. of Events" =0
| stats values("Last Job ended") as "Last Job ended", values("Job Status") as "Job Status", values("Duration per Event") as "Duration per Event",values("No. of Events") as "No. of Events"
| transpose
| rename column as "Statistic"
| rename "row 1" as "Value"</query>
<earliest>rt-10s</earliest>
<latest>rtnow</latest>
</search>
</table>
</panel>
<panel>
<table>
<title>Job Statistics</title>
<search>
<query>index=*
| eval "Start Date"=strftime(now(),"%Y-%m-%d")
| eval "Start Time"=strftime(now(),"%T")
| eval "End Date"=strftime(now(),"%Y-%m-%d")
| eval "End Time"=strftime(now(),"%T")
| eval "Duration in minutes"=0
| eval Status="INCOMPLETE"
| eval "No. of Records"=0
| table "Start Date", "Start Time", "End Date", "End Time", "Duration in minutes", Status, "No. of Records"</query>
<earliest>-1s@s</earliest>
<latest>now</latest>
</search>
</table>
</panel>
</row>
<row>
<panel>
<html>
<a href="?showBatchJob2=true">
<h1>Batch Job 2</h1>
</a>
</html>
</panel>
</row>
<row depends="$showBatchJob2$">
<panel>
<title></title>
<table>
<title>Latest Job Information</title>
<search>
<query>index=main
| eval "Last Job ended" ="00:00:00"
| eval "Job Status"="NOT DEFINED"
| eval "Duration per Event" =0
| eval "No. of Events" =0
| stats values("Last Job ended") as "Last Job ended", values("Job Status") as "Job Status", values("Duration per Event") as "Duration per Event",values("No. of Events") as "No. of Events"
| transpose
| rename column as "Statistic"
| rename "row 1" as "Value"</query>
<earliest>rt-10s</earliest>
<latest>rtnow</latest>
</search>
</table>
</panel>
<panel>
<table>
<title>Job Statistics</title>
<search>
<query>index=*
| eval "Start Date"=strftime(now(),"%Y-%m-%d")
| eval "Start Time"=strftime(now(),"%T")
| eval "End Date"=strftime(now(),"%Y-%m-%d")
| eval "End Time"=strftime(now(),"%T")
| eval "Duration in minutes"=0
| eval Status="INCOMPLETE"
| eval "No. of Records"=0
| table "Start Date", "Start Time", "End Date", "End Time", "Duration in minutes", Status, "No. of Records"</query>
<earliest>-1s@s</earliest>
<latest>now</latest>
</search>
</table>
</panel>
</row>
<row>
<panel>
<html>
<a href="?showBatchJob3=true">
<h1>Batch Job 3</h1>
</a>
</html>
</panel>
</row>
<row depends="$showBatchJob3$">
<panel>
<title></title>
<table>
<title>Latest Job Information</title>
<search>
<query>index=main
| eval "Last Job ended" ="00:00:00"
| eval "Job Status"="NOT DEFINED"
| eval "Duration per Event" =0
| eval "No. of Events" =0
| stats values("Last Job ended") as "Last Job ended", values("Job Status") as "Job Status", values("Duration per Event") as "Duration per Event",values("No. of Events") as "No. of Events"
| transpose
| rename column as "Statistic"
| rename "row 1" as "Value"</query>
<earliest>rt-10s</earliest>
<latest>rtnow</latest>
</search>
</table>
</panel>
<panel>
<table>
<title>Job Statistics</title>
<search>
<query>index=*
| eval "Start Date"=strftime(now(),"%Y-%m-%d")
| eval "Start Time"=strftime(now(),"%T")
| eval "End Date"=strftime(now(),"%Y-%m-%d")
| eval "End Time"=strftime(now(),"%T")
| eval "Duration in minutes"=0
| eval Status="INCOMPLETE"
| eval "No. of Records"=0
| table "Start Date", "Start Time", "End Date", "End Time", "Duration in minutes", Status, "No. of Records"</query>
<earliest>-1s@s</earliest>
<latest>now</latest>
</search>
</table>
</panel>
</row>
<row>
<panel>
<html>
<a href="?showBatchJob4=true">
<h1>Batch Job 4</h1>
</a>
</html>
</panel>
</row>
<row depends="$showBatchJob4$">
<panel>
<title></title>
<table>
<title>Latest Job Information</title>
<search>
<query>index=main
| eval "Last Job ended" ="00:00:00"
| eval "Job Status"="NOT DEFINED"
| eval "Duration per Event" =0
| eval "No. of Events" =0
| stats values("Last Job ended") as "Last Job ended", values("Job Status") as "Job Status", values("Duration per Event") as "Duration per Event",values("No. of Events") as "No. of Events"
| transpose
| rename column as "Statistic"
| rename "row 1" as "Value"</query>
<earliest>rt-10s</earliest>
<latest>rtnow</latest>
</search>
</table>
</panel>
<panel>
<table>
<title>Job Statistics</title>
<search>
<query>index=*
| eval "Start Date"=strftime(now(),"%Y-%m-%d")
| eval "Start Time"=strftime(now(),"%T")
| eval "End Date"=strftime(now(),"%Y-%m-%d")
| eval "End Time"=strftime(now(),"%T")
| eval "Duration in minutes"=0
| eval Status="INCOMPLETE"
| eval "No. of Records"=0
| table "Start Date", "Start Time", "End Date", "End Time", "Duration in minutes", Status, "No. of Records"</query>
<earliest>-1s@s</earliest>
<latest>now</latest>
</search>
</table>
</panel>
</row>
</dashboard>
... View more