<?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 Splunk Python conf file read/write in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Python-conf-file-read-write/m-p/481699#M8571</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;For an app creation, I need to create my own .conf file. Please inform me How I create a custom conf file, and how I read and write data in that conf file using Python.&lt;BR /&gt;Please inform me where I can learn Splunk Python packages, better if it in present in any youtube channel.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jun 2020 18:47:06 GMT</pubDate>
    <dc:creator>arun_kant_sharm</dc:creator>
    <dc:date>2020-06-07T18:47:06Z</dc:date>
    <item>
      <title>Splunk Python conf file read/write</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Python-conf-file-read-write/m-p/481699#M8571</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;For an app creation, I need to create my own .conf file. Please inform me How I create a custom conf file, and how I read and write data in that conf file using Python.&lt;BR /&gt;Please inform me where I can learn Splunk Python packages, better if it in present in any youtube channel.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Python-conf-file-read-write/m-p/481699#M8571</guid>
      <dc:creator>arun_kant_sharm</dc:creator>
      <dc:date>2020-06-07T18:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Python conf file read/write</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Python-conf-file-read-write/m-p/481700#M8572</link>
      <description>&lt;P&gt;Hi Arun.&lt;BR /&gt;
This might be a good starting point.&lt;BR /&gt;
&lt;A href="https://dev.splunk.com/enterprise/docs/python/sdk-python/examplespython/"&gt;https://dev.splunk.com/enterprise/docs/python/sdk-python/examplespython/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For conf files&lt;BR /&gt;
&lt;A href="https://dev.splunk.com/enterprise/docs/python/sdk-python/examplespython/commandline#Work-with-Splunk-configuration-files"&gt;https://dev.splunk.com/enterprise/docs/python/sdk-python/examplespython/commandline#Work-with-Splunk-configuration-files&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 11:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Python-conf-file-read-write/m-p/481700#M8572</guid>
      <dc:creator>mcederhage_splu</dc:creator>
      <dc:date>2019-11-11T11:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Python conf file read/write</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-Python-conf-file-read-write/m-p/481701#M8573</link>
      <description>&lt;P&gt;hi Arun,&lt;/P&gt;

&lt;P&gt;Your question is very broad, but I will try to answer it as specific as possible.&lt;/P&gt;

&lt;P&gt;Create Custom  .conf file&lt;BR /&gt;
- You can include &lt;CODE&gt;setup.xml&lt;/CODE&gt; in your application. Using it you can create your custom conf and modify it.&lt;BR /&gt;
- It will be accessible to users from "Manage Apps" page.&lt;BR /&gt;
- Setup page is useful when you want to customize an app for a particular usage&lt;BR /&gt;
- You can update the values using the setup page. The values will be saved in local directory of the app&lt;BR /&gt;
- &lt;A href="https://dev.splunk.com/enterprise/docs/developapps/setuppage"&gt;https://dev.splunk.com/enterprise/docs/developapps/setuppage&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Now, to read the custom conf value, use the below code with your splunk python script,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;from splunk.clilib import cli_common as cli
.
...
.
cfg = cli.getConfStanza('custom_conf_file_name','custom_stanza')
print cfg.get('parameter')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if you have any queries.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 12:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-Python-conf-file-read-write/m-p/481701#M8573</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2019-11-11T12:41:56Z</dc:date>
    </item>
  </channel>
</rss>

