<?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: Best way to create a custom config for an app in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12710#M1011</link>
    <description>&lt;P&gt;thanks, although I still have no good solution for my case of using a non-python scripted input. By the way, you can also use readConf() from splunk.admin to get .conf data as a dictionary.&lt;/P&gt;</description>
    <pubDate>Sat, 12 Jun 2010 13:13:52 GMT</pubDate>
    <dc:creator>Leo</dc:creator>
    <dc:date>2010-06-12T13:13:52Z</dc:date>
    <item>
      <title>Best way to create a custom config for an app</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12707#M1008</link>
      <description>&lt;P&gt;Ok, so now my app has a scripted input (Powershell) and setup.xml is communicating with an eai endpoint defined inside the app. That's great, but the question is how should I manage the configuration of my scripted input such as target's hostname, user credentials, etc? &lt;/P&gt;

&lt;P&gt;My first thought was to keep this information inside a plain xml file and have my script and the endpoint access it. But I guess this solution will make the settings global and won't work scale for multiple users, so I think I'm expected to use *.conf files instead. Plus it adds some inconsistency to the way Splunk keeps its configs.&lt;/P&gt;

&lt;P&gt;Going this way to collect the actual config in my script I should not only read a conf file from default\, but also merge it with a conf from local\ and, possibly, respect a conf inside users\someuser\myapp\my.conf. 
The last part seems confusing to me. How can I tell from my script which user's .conf should I read?&lt;/P&gt;

&lt;P&gt;Anyway that's just too many of details to implement in my simple script. I believe there should be a simpler way to manage config without duplicating what Splunk already can do. I guess my script could read the config from my app's EAI endpoint, but for this it needs to authenticate first. If I could pass the script a session key somehow that would be great..&lt;/P&gt;

&lt;P&gt;What would you recommend? Just stick with a simple xml?
thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2010 01:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12707#M1008</guid>
      <dc:creator>Leo</dc:creator>
      <dc:date>2010-05-01T01:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create a custom config for an app</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12708#M1009</link>
      <description>&lt;P&gt;I guess you've already figured this one out since it's more than a month old, but i figured I'd answer in case anyone else wonders.&lt;/P&gt;

&lt;P&gt;If you decide to use an .conf you can use splunk's built-in lib to access it, it's in splunk.clilib.cli_common, you can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunk.clilib.cli_common 
...
settings = splunk.clilib.cli_common.getConfStanza(my_conf_name,wanted_stanza)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The getConfStanza-function returns a dictionary with all your key-value pairs for that stanza.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2010 04:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12708#M1009</guid>
      <dc:creator>erydberg</dc:creator>
      <dc:date>2010-06-12T04:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create a custom config for an app</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12709#M1010</link>
      <description>&lt;P&gt;Ah, this might not work for you... Well, if anyone else uses scripted input in python this is a way to solve the problem. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2010 05:03:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12709#M1010</guid>
      <dc:creator>erydberg</dc:creator>
      <dc:date>2010-06-12T05:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create a custom config for an app</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12710#M1011</link>
      <description>&lt;P&gt;thanks, although I still have no good solution for my case of using a non-python scripted input. By the way, you can also use readConf() from splunk.admin to get .conf data as a dictionary.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2010 13:13:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12710#M1011</guid>
      <dc:creator>Leo</dc:creator>
      <dc:date>2010-06-12T13:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create a custom config for an app</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12711#M1012</link>
      <description>&lt;P&gt;Okay, do you know is there any difference between the two ways?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2010 23:29:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12711#M1012</guid>
      <dc:creator>erydberg</dc:creator>
      <dc:date>2010-06-14T23:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create a custom config for an app</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12712#M1013</link>
      <description>&lt;P&gt;also looking for some sign of an answer here. I don't want to use scripted input since i have 40+ fields in my setup.xml and i'm guess 100+ saved searches would have to reference a different script each. Is there any way to access these fields directly from the search bar?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2011 17:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12712#M1013</guid>
      <dc:creator>klee310</dc:creator>
      <dc:date>2011-03-31T17:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create a custom config for an app</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12713#M1014</link>
      <description>&lt;P&gt;Perhaps you could leverage the CLI?&lt;/P&gt;

&lt;P&gt;splunk btool &lt;CONFIG_FILE&gt; layer &lt;STANZA&gt;&lt;/STANZA&gt;&lt;/CONFIG_FILE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2012 20:31:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Best-way-to-create-a-custom-config-for-an-app/m-p/12713#M1014</guid>
      <dc:creator>melting</dc:creator>
      <dc:date>2012-09-19T20:31:53Z</dc:date>
    </item>
  </channel>
</rss>

