<?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: setup.xml to modify/create an entry in app.conf (or anywhere else) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/setup-xml-to-modify-create-an-entry-in-app-conf-or-anywhere-else/m-p/231990#M45204</link>
    <description>&lt;P&gt;Thanks for the info I have that in my configuration an excluded it from my example because that part worked. &lt;/P&gt;

&lt;P&gt;Unfortunately there are a few issues with this method.&lt;/P&gt;

&lt;P&gt;This only ever allows you to set it once. If you try to update the username/password it will return an error.&lt;/P&gt;

&lt;P&gt;Also when I go to use this stored password from another modular input I need to know the username when calling the REST interface. So I have a few choices here. I hardcode in the username into the python code for the modular input which sort of defeats the purpose of having a setup page.&lt;/P&gt;

&lt;P&gt;I'm going down the route of making a custom endpoint which will do the following&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Store the username and proxy server address in a custom.conf&lt;/LI&gt;
&lt;LI&gt;Update/create the password credentials directly via the REST interface as opposed to relying on the method in online examples.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I do wish there was an easy way to debug custom endpoints because the current errors that are returned from Splunk are utterly useless. &lt;BR /&gt;
&lt;A href="http://imgur.com/a/basRS"&gt;http://imgur.com/a/basRS&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;index=_internal sourcetype=splunkd&lt;BR /&gt;
also contains nothing useful&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;01-19-2017 10:32:42.492 +1000 ERROR AdminManagerExternal - &amp;lt;class 'splunk.admin.UsageException'&amp;gt;: Received no serialized data via stdin (mode: setup).  Will not continue.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 Jan 2017 00:45:37 GMT</pubDate>
    <dc:creator>phoenixdigital</dc:creator>
    <dc:date>2017-01-19T00:45:37Z</dc:date>
    <item>
      <title>setup.xml to modify/create an entry in app.conf (or anywhere else)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/setup-xml-to-modify-create-an-entry-in-app-conf-or-anywhere-else/m-p/231988#M45202</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've been trying to make a basic setup.xml that can create a stanza and config that I can access from a scripted input (Python)&lt;/P&gt;

&lt;P&gt;I know how to pull data out of a configuration file via the REST interface.&lt;/P&gt;

&lt;P&gt;What I can't do is a simple setup.xml such as this to create/modify an entry in app.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;setup&amp;gt;
    &amp;lt;block title="Proxy Server for API calls" endpoint="configs/conf-app" &amp;gt;

      &amp;lt;input field="proxy_server_username"&amp;gt;
        &amp;lt;label&amp;gt;Username&amp;lt;/label&amp;gt;
        &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
      &amp;lt;/input&amp;gt;
    &amp;lt;/block&amp;gt;
&amp;lt;/setup&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've built custom setup.xml files before and made my own endpoint but I was trying to just use the existing Splunk REST endpoints to just add this to app.conf.&lt;/P&gt;

&lt;P&gt;Is it possible or do I have to make a custom endpoint?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 05:48:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/setup-xml-to-modify-create-an-entry-in-app-conf-or-anywhere-else/m-p/231988#M45202</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2017-01-18T05:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: setup.xml to modify/create an entry in app.conf (or anywhere else)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/setup-xml-to-modify-create-an-entry-in-app-conf-or-anywhere-else/m-p/231989#M45203</link>
      <description>&lt;P&gt;Perhaps just use the inbuilt passwords.conf endpoint e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;setup&amp;gt;
  &amp;lt;block title="Proxy Server for API calls" endpoint="storage/passwords" entity="_new"&amp;gt;
    &amp;lt;input field="name"&amp;gt;
      &amp;lt;label&amp;gt;Username&amp;lt;/label&amp;gt;
      &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input field="password"&amp;gt;
      &amp;lt;label&amp;gt;Password&amp;lt;/label&amp;gt;
      &amp;lt;type&amp;gt;password&amp;lt;/type&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/block&amp;gt;
 &amp;lt;/setup&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jan 2017 00:08:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/setup-xml-to-modify-create-an-entry-in-app-conf-or-anywhere-else/m-p/231989#M45203</guid>
      <dc:creator>crash1011</dc:creator>
      <dc:date>2017-01-19T00:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: setup.xml to modify/create an entry in app.conf (or anywhere else)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/setup-xml-to-modify-create-an-entry-in-app-conf-or-anywhere-else/m-p/231990#M45204</link>
      <description>&lt;P&gt;Thanks for the info I have that in my configuration an excluded it from my example because that part worked. &lt;/P&gt;

&lt;P&gt;Unfortunately there are a few issues with this method.&lt;/P&gt;

&lt;P&gt;This only ever allows you to set it once. If you try to update the username/password it will return an error.&lt;/P&gt;

&lt;P&gt;Also when I go to use this stored password from another modular input I need to know the username when calling the REST interface. So I have a few choices here. I hardcode in the username into the python code for the modular input which sort of defeats the purpose of having a setup page.&lt;/P&gt;

&lt;P&gt;I'm going down the route of making a custom endpoint which will do the following&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Store the username and proxy server address in a custom.conf&lt;/LI&gt;
&lt;LI&gt;Update/create the password credentials directly via the REST interface as opposed to relying on the method in online examples.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I do wish there was an easy way to debug custom endpoints because the current errors that are returned from Splunk are utterly useless. &lt;BR /&gt;
&lt;A href="http://imgur.com/a/basRS"&gt;http://imgur.com/a/basRS&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;index=_internal sourcetype=splunkd&lt;BR /&gt;
also contains nothing useful&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;01-19-2017 10:32:42.492 +1000 ERROR AdminManagerExternal - &amp;lt;class 'splunk.admin.UsageException'&amp;gt;: Received no serialized data via stdin (mode: setup).  Will not continue.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jan 2017 00:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/setup-xml-to-modify-create-an-entry-in-app-conf-or-anywhere-else/m-p/231990#M45204</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2017-01-19T00:45:37Z</dc:date>
    </item>
  </channel>
</rss>

