Dashboards & Visualizations

How to create a dashboard button that triggers a shell/python script with input?

ineedafleeb
Engager

Hey Guys

So I want to be able to create a button that has an input in it. I'm wondering if this is possible?

The idea is that you input an IP address and then it would go and tell your IPS/Firewall to block from this dashboard.

Thanks!

0 Karma
1 Solution

DavidHourani
Super Champion

Hi @ineedafleeb,

It is possible ! And quite simple if you can code a bit. All you have to do is build an advanced command, you can learn more about this here :
http://dev.splunk.com/view/python-sdk/SP-CAAAEU2

Instead of building a command that will run on the search results just build one that takes an IP as an input and then send it off to your IPS/Firewall to have the protocol, port or IP blocked.

Feel free to share your code once you're done if you need help reviewing or improving it.

Cheers,
David

View solution in original post

0 Karma

DavidHourani
Super Champion

Hi @ineedafleeb,

It is possible ! And quite simple if you can code a bit. All you have to do is build an advanced command, you can learn more about this here :
http://dev.splunk.com/view/python-sdk/SP-CAAAEU2

Instead of building a command that will run on the search results just build one that takes an IP as an input and then send it off to your IPS/Firewall to have the protocol, port or IP blocked.

Feel free to share your code once you're done if you need help reviewing or improving it.

Cheers,
David

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...