Getting Data In

How to configure default values for parameters on Modular Inputs

andyrobinson
New Member

I am using C# SDK 2.0 and Visual Studio 2013 Extension for creating Modular Inputs. I am trying to understand the best way to specify default values for parameters, if it is even possible.

0 Karma
1 Solution

Damien_Dallimor
Ultra Champion

There are 2 ways that come to mind :

1) hard code some defaults in your C# code. But then they are fixed as they are in compiled code.

2) So perhaps better , ship your modular input with a default/inputs.conf file that defines a parent stanza with defaults.

So , your default/inputs.conf might look like :

[foo]
some_default_param = 123

And then when users setup stanzas they can inherit the default parameters or override them

[foo://mystanza]
abc=1

[foo://anotherstanza]
abc =2
some_default_param = 678

View solution in original post

0 Karma

andyrobinson
New Member

That is the perfect answer I was looking for.

Thanks!

0 Karma

Damien_Dallimor
Ultra Champion

There are 2 ways that come to mind :

1) hard code some defaults in your C# code. But then they are fixed as they are in compiled code.

2) So perhaps better , ship your modular input with a default/inputs.conf file that defines a parent stanza with defaults.

So , your default/inputs.conf might look like :

[foo]
some_default_param = 123

And then when users setup stanzas they can inherit the default parameters or override them

[foo://mystanza]
abc=1

[foo://anotherstanza]
abc =2
some_default_param = 678
0 Karma

ruchika11
New Member

I changed my input.conf file but not able to see my default value on splunk setting=>data=>input=>app=>new page

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 Certification at ...

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 ...