<?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: Splunk Add-on Builder: Custom inputs.conf configuration option in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Add-on-Builder-Custom-inputs-conf-configuration-option/m-p/529344#M9468</link>
    <description>&lt;P&gt;When you add a parameter thru UI, AoB will do following things for you:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Add the parameter definition in /README/inputs.conf.spec&lt;/LI&gt;&lt;LI&gt;Add the default value in /default/inputs.conf&lt;/LI&gt;&lt;LI&gt;Add the parameter in custom REST endpoint to operate this value thru Splunk REST API&lt;/LI&gt;&lt;LI&gt;Update Addon UI&lt;/LI&gt;&lt;LI&gt;Update AoB internal metadata&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If we want to add one parameter without AoB, please follow Splunk doc to create modular input manually. If we still want to use AoB to read/write this parameter in Python code, please do #1,2,3 manually. But basically this hack approach is not officially supported by AoB. We can try it but not guaranteed it's gonna work.&lt;/P&gt;&lt;P&gt;Personal speaking, add this optional parameter via AoB UI with a default value is not harmful. If you really want to hide it from Addon UI, you can try to add it first, and then update Addon frontend code to remove it. That could be an easier approach.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 18:15:13 GMT</pubDate>
    <dc:creator>chli_splunk</dc:creator>
    <dc:date>2020-11-13T18:15:13Z</dc:date>
    <item>
      <title>Splunk Add-on Builder: Custom inputs.conf configuration option</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Add-on-Builder-Custom-inputs-conf-configuration-option/m-p/528521#M9467</link>
      <description>&lt;P&gt;Hi Splunk Community,&lt;/P&gt;&lt;P&gt;I am building a Python modular input using the Splunk add-on builder tool and I want to add a custom configuration option '&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;performance_custom_metrics'&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;which is optional and set only in &lt;FONT face="courier new,courier"&gt;inputs.conf&lt;/FONT&gt;, not via the data input UI configuration defined when building the add-on.&lt;/P&gt;&lt;P&gt;Everything seems fine for the most part, but when I try to add a new data input I get the following error about the optional config option:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;The following required arguments are missing: performance_custom_metrics&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Because&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;performance_custom_metrics &lt;FONT face="arial,helvetica,sans-serif"&gt;is not defined in the add-on UI configuration I am not allowed to create inputs via the UI. Only manual creation via&lt;/FONT&gt; inputs.conf &lt;FONT face="arial,helvetica,sans-serif"&gt;works as expected.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I've set&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;required_on_create&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;required_on_edit&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;both to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;False&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;when defining the argument in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;inputs.py&lt;/FONT&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;scheme.add_argument(smi.Argument(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;    &lt;SPAN&gt;'performance_custom_metrics'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;required_on_create&lt;/SPAN&gt;=&lt;SPAN&gt;False,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;required_on_edit&lt;/SPAN&gt;=&lt;SPAN&gt;False&lt;/SPAN&gt;))&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;From&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;solnlib/packages/splunklib/modularinput/argument.py #60&lt;/FONT&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;:param&lt;/SPAN&gt;&lt;SPAN&gt; required_on_edit: ``Boolean``, whether this arg is required when editing an existing modular input of this kind.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;:param&lt;/SPAN&gt;&lt;SPAN&gt; required_on_create: ``Boolean``, whether this arg is required when creating a modular input of this kind.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Has anyone any idea what other option I need to set to make&amp;nbsp;&lt;FONT face="courier new,courier"&gt;performance_custom_metrics&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;an optional input parameter for my add-on?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 12:07:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Add-on-Builder-Custom-inputs-conf-configuration-option/m-p/528521#M9467</guid>
      <dc:creator>MichaelMcAleer</dc:creator>
      <dc:date>2020-11-09T12:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Add-on Builder: Custom inputs.conf configuration option</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Add-on-Builder-Custom-inputs-conf-configuration-option/m-p/529344#M9468</link>
      <description>&lt;P&gt;When you add a parameter thru UI, AoB will do following things for you:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Add the parameter definition in /README/inputs.conf.spec&lt;/LI&gt;&lt;LI&gt;Add the default value in /default/inputs.conf&lt;/LI&gt;&lt;LI&gt;Add the parameter in custom REST endpoint to operate this value thru Splunk REST API&lt;/LI&gt;&lt;LI&gt;Update Addon UI&lt;/LI&gt;&lt;LI&gt;Update AoB internal metadata&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If we want to add one parameter without AoB, please follow Splunk doc to create modular input manually. If we still want to use AoB to read/write this parameter in Python code, please do #1,2,3 manually. But basically this hack approach is not officially supported by AoB. We can try it but not guaranteed it's gonna work.&lt;/P&gt;&lt;P&gt;Personal speaking, add this optional parameter via AoB UI with a default value is not harmful. If you really want to hide it from Addon UI, you can try to add it first, and then update Addon frontend code to remove it. That could be an easier approach.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:15:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Add-on-Builder-Custom-inputs-conf-configuration-option/m-p/529344#M9468</guid>
      <dc:creator>chli_splunk</dc:creator>
      <dc:date>2020-11-13T18:15:13Z</dc:date>
    </item>
  </channel>
</rss>

