Splunk Dev

Why is the app setup screen not able to save settings?

cmeerbeek
Path Finder

I have created a setup.xml in an app which has multiple python scripts and I want to manage them from the setup screen.
The setup.xml is as follows:

<setup>
  <block title="Octopus Deploy Inputs" endpoint="data/inputs/script" entity="*">
    <input field="interval">
      <label>Polling Interval (sec): $name$</label>
      <type>text</type>
    </input>
  </block>
</setup>

It reads the data perfectly and if I change it locally it automatically updates but when I press save it fails...

Error is: Encountered the following error while trying to update: Cannot find item for POST arg_name="/data/inputs/script/%24SPLUNK_HOME%252Fetc%252Fapps%252FTA-Octopus-Fwd%252Fbin%252Fget_machines.py/interval"

Can someone point me in the right direction? I already tried endpoint="admin/script", I tried putting the entities hardcoded in the xml, I tried putting the entities at the input level in the xml. Nothing worked so far.

0 Karma
1 Solution

cmeerbeek
Path Finder

I solved my own problem but I still don't know how to do a bulk update.

What I did was:

<setup>
  <block title="Octopus Deploy Machines" endpoint="admin/script" entity=".%252Fbin%252Fget_machines.py">
    <input field="interval">
      <label>Polling Interval (sec): $name$</label>
      <type>text</type>
    </input>
    <input field="enabled" old_style_disable="true">
      <label>Enable: $name$</label>
      <type>bool</type>
    </input>
  </block>
  <block title="Octopus Deploy Projects" endpoint="admin/script" entity=".%252Fbin%252Fget_projects.py">
    <input field="interval">
      <label>Polling Interval (sec): $name$</label>
      <type>text</type>
    </input>
    <input field="enabled" old_style_disable="true">
      <label>Enable: $name$</label>
      <type>bool</type>
    </input>
  </block>
</setup>

The Python files are hardcoded and the input stanza is different than it as.
Inputs.conf was: [script://$SPLUNK_HOME/etc/apps/TA-Octopus-Fwd/bin/get_machines.py] and now is [script://./bin/get_machines.py].

If someone knows a way to write a setup.xml which handles all inputs I am happy!

View solution in original post

0 Karma

cmeerbeek
Path Finder

I solved my own problem but I still don't know how to do a bulk update.

What I did was:

<setup>
  <block title="Octopus Deploy Machines" endpoint="admin/script" entity=".%252Fbin%252Fget_machines.py">
    <input field="interval">
      <label>Polling Interval (sec): $name$</label>
      <type>text</type>
    </input>
    <input field="enabled" old_style_disable="true">
      <label>Enable: $name$</label>
      <type>bool</type>
    </input>
  </block>
  <block title="Octopus Deploy Projects" endpoint="admin/script" entity=".%252Fbin%252Fget_projects.py">
    <input field="interval">
      <label>Polling Interval (sec): $name$</label>
      <type>text</type>
    </input>
    <input field="enabled" old_style_disable="true">
      <label>Enable: $name$</label>
      <type>bool</type>
    </input>
  </block>
</setup>

The Python files are hardcoded and the input stanza is different than it as.
Inputs.conf was: [script://$SPLUNK_HOME/etc/apps/TA-Octopus-Fwd/bin/get_machines.py] and now is [script://./bin/get_machines.py].

If someone knows a way to write a setup.xml which handles all inputs I am happy!

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...