Getting Data In

setup.xml to modify/create an entry in app.conf (or anywhere else)

phoenixdigital
Builder

Hi,

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)

I know how to pull data out of a configuration file via the REST interface.

What I can't do is a simple setup.xml such as this to create/modify an entry in app.conf

<setup>
    <block title="Proxy Server for API calls" endpoint="configs/conf-app" >

      <input field="proxy_server_username">
        <label>Username</label>
        <type>text</type>
      </input>
    </block>
</setup>

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.

Is it possible or do I have to make a custom endpoint?

Tags (2)

crash1011
Explorer

Perhaps just use the inbuilt passwords.conf endpoint e.g.

<setup>
  <block title="Proxy Server for API calls" endpoint="storage/passwords" entity="_new">
    <input field="name">
      <label>Username</label>
      <type>text</type>
    </input>
    <input field="password">
      <label>Password</label>
      <type>password</type>
    </input>
  </block>
 </setup>
0 Karma

phoenixdigital
Builder

Thanks for the info I have that in my configuration an excluded it from my example because that part worked.

Unfortunately there are a few issues with this method.

This only ever allows you to set it once. If you try to update the username/password it will return an error.

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.

I'm going down the route of making a custom endpoint which will do the following

  1. Store the username and proxy server address in a custom.conf
  2. Update/create the password credentials directly via the REST interface as opposed to relying on the method in online examples.

I do wish there was an easy way to debug custom endpoints because the current errors that are returned from Splunk are utterly useless.
http://imgur.com/a/basRS

index=_internal sourcetype=splunkd
also contains nothing useful

01-19-2017 10:32:42.492 +1000 ERROR AdminManagerExternal - <class 'splunk.admin.UsageException'>: Received no serialized data via stdin (mode: setup).  Will not continue.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...