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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...