Dashboards & Visualizations

Integrating Splunk Dashboard With Python

shreshthsharma
Engager

Hi I'm trying to build a splunk dashboard which sends a token to a python script and then after processing the token value gets updated using the python script, the question is can i directly make the dashboard interact with python or do i need to add a javascript in between the two?

0 Karma
1 Solution

niketn
Legend

@shreshthsharma, you can use script command in Splunk search to execute a python script placed under $SPLUNK_HOME/etc/apps/<your_app_name>/bin/ path. Refer to Splunk documentation: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Script

Then your python script can write back to Splunk using print and sys.stderr.write. Refer to a simple python scripted input example: https://sublimerobots.com/2017/01/simple-splunk-scripted-input-example/

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

View solution in original post

niketn
Legend

@shreshthsharma, you can use script command in Splunk search to execute a python script placed under $SPLUNK_HOME/etc/apps/<your_app_name>/bin/ path. Refer to Splunk documentation: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Script

Then your python script can write back to Splunk using print and sys.stderr.write. Refer to a simple python scripted input example: https://sublimerobots.com/2017/01/simple-splunk-scripted-input-example/

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...