Splunk Search

Add a clock to the header

hartfoml
Motivator

Anyone have a suggestion on how I can add a digital clock or even a world clock to the header in the default view for my APP?

Tags (2)
0 Karma

jhupka
Path Finder

One way is via a simple javascript clock widget.

Within your app you can have a javascript file that gets included with your views when rendered. This is placed in the appserver/static/application.js file (it has to be that name/location) of your app.

For a simple clock example, try adding the javascript from here:

http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_clock

Then, you'll need to include the HTML portion from the W3 sample (i.e. the div tag) in your view somehow - via Sideview's HTMLModule or one of the other mechanisms to add raw HTML to your view.

0 Karma

hartfoml
Motivator

this is probably the right answer and thanks for the help.

I guess this is just a little out of my reach.
I don't know how to create the .js widget from the code sample. Is the .js just a text readable file with the .js extension?

Also I need the numbers to be color "white" since the clock is on a black background and I need them to be a larger font.

Please forgive me I'm learning here.
Thanks again for your help.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...