Getting Data In

user-specific configurations to scripted inputs as input arguments

wanling
Path Finder

I am working on a scripted input that requires user-specific configurations (e.g. AccountKey, UserToken) as input arguments. These settings are preferably configured at inputs.conf like AccountKey=xxx. However how can these be read by the script?

I've seen innovative way to put them in the script directly ([script:///usr/test/dq_test.pl MAHN 0.25]). But it's really not so neat, and can be quite messy if the number of arguments grows or the values are lengthy. In my case, these values are not known during development time, hence i need a more fool proof way to allow user to put them in.

Tags (1)
0 Karma

MuS
Legend

Hi wanling,

take a look at the Webmon App, download it and look at the scripts and who they handle looping through a .conf file. I used this app to start my own scripted inputs using .conf files.

If you get the script working with your .conf file you can use the REST API to modify your .conf and build a fool proof web UI for your users.

hope this helps to get you started ...

cheers, MuS

0 Karma

wanling
Path Finder

Hi MuS, thanks for the suggestion. After taking a look at the webmon app, i cant help thinking that 1) how is it different from modular input? Will modular input be a even better choice? 2) why not make use of the "interval" attribute for a scripted input, instead of implementing a loop with a sleeping break in the script?

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...