<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I make a parameter optional in a modular input? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-make-a-parameter-optional-in-a-modular-input/m-p/214728#M2837</link>
    <description>&lt;P&gt;From  &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/AdvancedDev/ModInputsScripts#Define_a_scheme_for_introspection"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/AdvancedDev/ModInputsScripts#Define_a_scheme_for_introspection&lt;/A&gt; , below probably should help you,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;required_on_edit&amp;gt;  true | false (Default is false.)

Indicates whether the parameter is required for edit. Default behavior is that arguments for edit are optional. Set this to true to override this behavior, and make the parameter required.

&amp;lt;required_on_create&amp;gt;    true | false (Default is true.)

Indicates whether the parameter is required for create. Default behavior is that arguments for create are required. Set this to false to override this behavior, and make the parameter optional. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Jan 2017 04:17:07 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2017-01-05T04:17:07Z</dc:date>
    <item>
      <title>How can I make a parameter optional in a modular input?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-make-a-parameter-optional-in-a-modular-input/m-p/214727#M2836</link>
      <description>&lt;P&gt;I've created a modular input using the Python API. I would like to know how I can make parameters optional. &lt;/P&gt;

&lt;P&gt;I have set hard-coded defaults in inputs.conf and in the script itself, however, the GUI add input page has all fields set to mandatory -- I would like to change this. &lt;/P&gt;

&lt;P&gt;My scheme is defined in the python script itself, a sample is below. How can I make a parameter optional?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SCHEME = """&amp;lt;scheme&amp;gt;
    &amp;lt;title&amp;gt;SOAP Polling&amp;lt;/title&amp;gt;
    &amp;lt;description&amp;gt;Get data from a SOAP Service.&amp;lt;/description&amp;gt;
    &amp;lt;use_external_validation&amp;gt;true&amp;lt;/use_external_validation&amp;gt;
    &amp;lt;streaming_mode&amp;gt;simple&amp;lt;/streaming_mode&amp;gt;
    &amp;lt;endpoint&amp;gt;
        &amp;lt;args&amp;gt;
            &amp;lt;arg name="param1"&amp;gt;
                &amp;lt;title&amp;gt;my title&amp;lt;/title&amp;gt;
                &amp;lt;description&amp;gt;my description&amp;lt;/description&amp;gt;
            &amp;lt;/arg&amp;gt;
            &amp;lt;arg name="param2"&amp;gt; &amp;lt;!-- I want to make this optional --&amp;gt;
                &amp;lt;title&amp;gt;my title&amp;lt;/title&amp;gt;
                &amp;lt;description&amp;gt;my description&amp;lt;/description&amp;gt;
            &amp;lt;/arg&amp;gt;
        &amp;lt;/args&amp;gt;
    &amp;lt;/endpoint&amp;gt;
&amp;lt;/scheme&amp;gt;
"""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jan 2017 22:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-can-I-make-a-parameter-optional-in-a-modular-input/m-p/214727#M2836</guid>
      <dc:creator>andrew207</dc:creator>
      <dc:date>2017-01-04T22:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make a parameter optional in a modular input?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-make-a-parameter-optional-in-a-modular-input/m-p/214728#M2837</link>
      <description>&lt;P&gt;From  &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/AdvancedDev/ModInputsScripts#Define_a_scheme_for_introspection"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/AdvancedDev/ModInputsScripts#Define_a_scheme_for_introspection&lt;/A&gt; , below probably should help you,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;required_on_edit&amp;gt;  true | false (Default is false.)

Indicates whether the parameter is required for edit. Default behavior is that arguments for edit are optional. Set this to true to override this behavior, and make the parameter required.

&amp;lt;required_on_create&amp;gt;    true | false (Default is true.)

Indicates whether the parameter is required for create. Default behavior is that arguments for create are required. Set this to false to override this behavior, and make the parameter optional. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 04:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-can-I-make-a-parameter-optional-in-a-modular-input/m-p/214728#M2837</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2017-01-05T04:17:07Z</dc:date>
    </item>
  </channel>
</rss>

