How To Add Time In The Dashboard Panel
We have shown in our earlier post we have shown that how to add the time in the dashboard panel title. This blog is quite similar to that but in this time we will try to add the time in human readable format in a Single value panel.
So let’s start :
Here will write a query to populate the time range in human readable format. The query is given below.
| gentimes start=-1 | addinfo | convert ctime(*) | eval reportDate=info_min_time." to ".info_max_time | table reportDate | rex field=reportDate "(?<FirstPart>.*\d+:\d+:\d+).*\s+to\s+(?<SecondPart>.*\d+:\d+:\d+)" | eval reportDate=FirstPart." to ".SecondPart | fields reportDate
Then select the visualization as Single value and try to save that panel as a dashboard.
We have given the dashboard name as “Time In The Single Value Panel”. Then click on save to save the changes.
After that one we will add a time range picker in the dashboard. If you don’t know how to add a time range picker in the dashboard please click here.
Now you can see we are getting the values in a single value panel in human readable format for the selected time range.
To format the single value text we have used the CSS in the source code. Please find below the screen shot.
We have use an id called “single1” also we have set the font-size as 30px. Then we have passed the id in the dashboard row so that it can take the reference of the CSS in that row.
Hope you can now implement this by yourself to meet the daily requirements.
Happy Splunking !!