Splunk Dev

running a python script in dashboard

mdmaala
Communicator

hi! for my dashboard, I want to add a duration timer using a python script. is it possible to do this in splunk? thank you so much!

0 Karma

harshpatel
Contributor

You can put custom javascript which does service request every time the interval runs out. The service can be a custom endpoint which runs your python script.

var service = mvc.createService();
service.get('/services/custom_endpoint', params, function (err, response) {
    if (!err) {
       // do something
    }
});

mdmaala
Communicator

thank you so much! I will try this!

0 Karma

niketn
Legend

@mdmaala, you can check out script command that you can execute through SPL. The documentation also has link to creation of a custom search command using python and other language.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

mdmaala
Communicator

I'll check on this. thank you so much @niketnilay !

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 ...