Dashboards & Visualizations

Is it possible to update inputs.conf using input parameters taken from a dashboard splunk[splunk js]

anushay
New Member

Hi,

How can i send parameters from splunk js to python script using inputs.conf

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi @anushay,

Yes, you can update configuration from dashboard using splunkjs.

1) Create custom endpoint which update configuration files. like inputs.conf.

see link for custom command tutorial: https://www.hurricanelabs.com/splunk-tutorials/splunk-custom-endpoints-part-1-the-basics

OR

You can use Splunk REST API for accessing/modifying configurations.

see below links:

http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/RESTREF/RESTinput

http://docs.splunk.com/Documentation/Splunk/6.0/RESTAPI/RESTinput

2) Use mvc.service for accessing custom endpoint / REST API from javascript .
eg,

var deps = [
            "splunkjs/ready!",
            "splunkjs/mvc"
        ];
require(deps, function(mvc) {
    var service = mvc.createService();
    service.post(MY_URL, {}, function(err, response) {
    //HANDLE Request
     });
});

see below links to javascript:

http://dev.splunk.com/view/webframework-developapps/SP-CAAAE4A
http://dev.splunk.com/view/webframework-tutorials/SP-CAAAERA
http://dev.splunk.com/view/webframework-tutorials/SP-CAAAERB

I hope this information will help you to start. Let me know if any help required.

Happy Splunking

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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