<?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 custom config values in workflow UI? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/custom-config-values-in-workflow-UI/m-p/81067#M809</link>
    <description>&lt;P&gt;I was wondering if it were possible to use $variable$ items in workflow actions that you have stored in a custom config file, or is it limited to backend scripts and *_renderers.&lt;/P&gt;

&lt;P&gt;If it is possible, how does one go about referencing them?&lt;/P&gt;</description>
    <pubDate>Sun, 31 Oct 2010 10:27:00 GMT</pubDate>
    <dc:creator>caphrim007</dc:creator>
    <dc:date>2010-10-31T10:27:00Z</dc:date>
    <item>
      <title>custom config values in workflow UI?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/custom-config-values-in-workflow-UI/m-p/81067#M809</link>
      <description>&lt;P&gt;I was wondering if it were possible to use $variable$ items in workflow actions that you have stored in a custom config file, or is it limited to backend scripts and *_renderers.&lt;/P&gt;

&lt;P&gt;If it is possible, how does one go about referencing them?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Oct 2010 10:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/custom-config-values-in-workflow-UI/m-p/81067#M809</guid>
      <dc:creator>caphrim007</dc:creator>
      <dc:date>2010-10-31T10:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: custom config values in workflow UI?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/custom-config-values-in-workflow-UI/m-p/81068#M810</link>
      <description>&lt;P&gt;After perusing through the various Splunk.* javascript libraries, I think the answer is "no" so as a workaround one can do the following and achieve the desired effect.&lt;/P&gt;

&lt;P&gt;Add a ServerSideInclude module in your view&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="ServerSideInclude" layoutPanel="appHeader"&amp;gt;
  &amp;lt;param name="src"&amp;gt;include.html&amp;lt;/param&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, in the include.html (which should reside in your apps appserver/static/ directory) you can include the following code which leverages internal splunk stuff that I found in various source files.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;%
import splunk.bundle as bundle

retDict = {}
try:
  thing = bundle.getConf('myapp', namespace="MyApp")
  for s in thing:
    retDict[s] = {}
    retDict[s].update(thing[s].items())
except splunk.ResourceNotFound:
  pass

%&amp;gt;

&amp;lt;div id='AppConfig'&amp;gt;
  &amp;lt;input type='hidden' name='AppUsername' value='${retDict['appliance']['username']}'&amp;gt;
  &amp;lt;input type='hidden' name='AppPassword' value='${retDict['appliance']['password']}'&amp;gt;
  &amp;lt;input type='hidden' name='AppHostname' value='${retDict['appliance']['hostname']}'&amp;gt;
  &amp;lt;input type='hidden' name='AppPort' value='${retDict['appliance']['port']}'&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your app specific config file, in this case myapp.conf is located at local/myapp.conf and the contents of it are populated into the &lt;CODE&gt;retDict&lt;/CODE&gt; variable.&lt;/P&gt;

&lt;P&gt;Sample contents of local/myapp.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[appliance]
username = myuser
password = mypassword
hostname = my.host.org
port = 443
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The end result of this is that you can get creative in your &lt;CODE&gt;application.js&lt;/CODE&gt; file; being able to use the values that you save via setup.xml to your custom app config file.&lt;/P&gt;

&lt;P&gt;Still interested to know if there is a better way to go about getting those custom configs.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2010 00:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/custom-config-values-in-workflow-UI/m-p/81068#M810</guid>
      <dc:creator>caphrim007</dc:creator>
      <dc:date>2010-11-09T00:02:03Z</dc:date>
    </item>
  </channel>
</rss>

