<?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: Adding multiple stanza as list in conf file via setup.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Adding-multiple-stanza-as-list-in-conf-file-via-setup-conf/m-p/103369#M183072</link>
    <description>&lt;P&gt;I don't think you can hook directly into the manager.  However, it sounds like you can try the setup route.  After you create setup you can access it via Manager &amp;gt; App and next to your app, there will be setup link.&lt;/P&gt;

&lt;P&gt;Have you taken a look at this:
&lt;BR /&gt;
&lt;A href="http://www.splunk.com/wiki/Create_a_setup_screen_to_modify_conf_files" rel="nofollow"&gt;http://www.splunk.com/wiki/Create_a_setup_screen_to_modify_conf_files&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It sounds like what you're looking for.  You'll need to make a setup.xml for your app.  The limitation as mentioned on that page is "The .conf files and stanza(s) you want to modify must already exist."&lt;/P&gt;

&lt;P&gt;If you're looking at more flexibility (dynamically create a stanza) take a look here:
&lt;BR /&gt;
&lt;A href="http://www.splunk.com/wiki/Create_setup_screen_using_a_custom_endpoint" rel="nofollow"&gt;http://www.splunk.com/wiki/Create_setup_screen_using_a_custom_endpoint&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You will need to write your own endpoint.  But you'll have control over specifying the stanza (whether update or create), and key/values that go under that stanza.&lt;/P&gt;

&lt;P&gt;Take note:&lt;/P&gt;

&lt;P&gt;def handleEdit(self, confInfo):
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.writeConf('myappsetup', 'setupentity', self.callerArgs.data)&lt;/P&gt;

&lt;P&gt;The parameters to writeConf():
&lt;BR /&gt;
'myappsetup' ==&amp;gt; filename of the .conf you want to write, inputs.conf would be 'inputs'
&lt;BR /&gt;
'setupentity' ==&amp;gt; the stanza name, i.e. 'script://./bin/myScript.sh'
&lt;BR /&gt;
self.callerArgs.data ==&amp;gt; the key/values you want for the stanza.
&lt;BR /&gt;&lt;BR /&gt;
callerArgs.data is an associative array like so:
&lt;BR /&gt;
{"disabled":0, "interval":60} 
&lt;BR /&gt;&lt;BR /&gt;
It's likely those values won't be static, so you'd need some additional logic to grab those values from setup.xml&lt;/P&gt;</description>
    <pubDate>Fri, 04 Feb 2011 05:54:52 GMT</pubDate>
    <dc:creator>dleung</dc:creator>
    <dc:date>2011-02-04T05:54:52Z</dc:date>
    <item>
      <title>Adding multiple stanza as list in conf file via setup.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-multiple-stanza-as-list-in-conf-file-via-setup-conf/m-p/103368#M183071</link>
      <description>&lt;P&gt;For my app i have my own .conf file. The app is the webmonitor app that will on a schedule iterate through a list of urls and time the request, check size, crc contents, etc..&lt;/P&gt;

&lt;P&gt;I'd like to reuse the manager or setup.conf system be able to let users add/delete/edit a URL - which is just a stanza in my own conf. Is there a mechanism to hook into manager or via setup.conf let me manage a list of stanza's?  I want to reuse the UI for managing file inputs but not manipulate my conf/stanzas.&lt;/P&gt;

&lt;P&gt;Thanks in advance!
e&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2010 03:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-multiple-stanza-as-list-in-conf-file-via-setup-conf/m-p/103368#M183071</guid>
      <dc:creator>Erik_Swan</dc:creator>
      <dc:date>2010-12-11T03:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding multiple stanza as list in conf file via setup.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-multiple-stanza-as-list-in-conf-file-via-setup-conf/m-p/103369#M183072</link>
      <description>&lt;P&gt;I don't think you can hook directly into the manager.  However, it sounds like you can try the setup route.  After you create setup you can access it via Manager &amp;gt; App and next to your app, there will be setup link.&lt;/P&gt;

&lt;P&gt;Have you taken a look at this:
&lt;BR /&gt;
&lt;A href="http://www.splunk.com/wiki/Create_a_setup_screen_to_modify_conf_files" rel="nofollow"&gt;http://www.splunk.com/wiki/Create_a_setup_screen_to_modify_conf_files&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It sounds like what you're looking for.  You'll need to make a setup.xml for your app.  The limitation as mentioned on that page is "The .conf files and stanza(s) you want to modify must already exist."&lt;/P&gt;

&lt;P&gt;If you're looking at more flexibility (dynamically create a stanza) take a look here:
&lt;BR /&gt;
&lt;A href="http://www.splunk.com/wiki/Create_setup_screen_using_a_custom_endpoint" rel="nofollow"&gt;http://www.splunk.com/wiki/Create_setup_screen_using_a_custom_endpoint&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You will need to write your own endpoint.  But you'll have control over specifying the stanza (whether update or create), and key/values that go under that stanza.&lt;/P&gt;

&lt;P&gt;Take note:&lt;/P&gt;

&lt;P&gt;def handleEdit(self, confInfo):
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.writeConf('myappsetup', 'setupentity', self.callerArgs.data)&lt;/P&gt;

&lt;P&gt;The parameters to writeConf():
&lt;BR /&gt;
'myappsetup' ==&amp;gt; filename of the .conf you want to write, inputs.conf would be 'inputs'
&lt;BR /&gt;
'setupentity' ==&amp;gt; the stanza name, i.e. 'script://./bin/myScript.sh'
&lt;BR /&gt;
self.callerArgs.data ==&amp;gt; the key/values you want for the stanza.
&lt;BR /&gt;&lt;BR /&gt;
callerArgs.data is an associative array like so:
&lt;BR /&gt;
{"disabled":0, "interval":60} 
&lt;BR /&gt;&lt;BR /&gt;
It's likely those values won't be static, so you'd need some additional logic to grab those values from setup.xml&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2011 05:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-multiple-stanza-as-list-in-conf-file-via-setup-conf/m-p/103369#M183072</guid>
      <dc:creator>dleung</dc:creator>
      <dc:date>2011-02-04T05:54:52Z</dc:date>
    </item>
  </channel>
</rss>

