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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...