Getting Data In

Setup.xml handle save (POST) to a scripted input error

manishmenon86
New Member

So here are the details. I have an app called myapp.
under myapp/default I have a setup.xml defined like this

  <!-- Note that the path to the script uses URI encoding -->
  <block title="Enable a scripted input"
         endpoint="data/inputs/script"
         entity="%24SPLUNK_HOME%252Fetc%252Fapps%252Fmyapp%252Fbin%252Fmyscript.sh">
    <text>
      <i>Specify the configuration for a single setting in a stanza.</i>
    </text>

    <input field="interval">
      <label>Specify the interval for [$name$] </label>
      <type>text</type>
    </input>

  </block>

</setup>

I have myscript.sh under myapp/bin

#!/bin/sh
echo "Yay! You called me!"

Now when I navigate to the app, the setup page comes up. I update the interval and click save and get the following error

Encountered the following error while trying to update: Cannot find item for POST arg_name="/data/inputs/script/%24SPLUNK_HOME%252Fetc%252Fapps%252Fmyapp%252Fbin%252Fmyscript.sh/interval"

I have checked and the endpoint

https://localhost:8089/servicesNS/nobody/myapp/data/inputs/script/%24SPLUNK_HOME%252Fetc%252Fapps%25...

exists.

Not sure yet what is going on? Help please.

0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@manishmenon86

Can you please try this?

setup.xml

<setup>
  <block title="My Scripted Input" endpoint="data/inputs/script" entity=".%252Fbin%252Fmyscript.sh">
    <input field="interval">
      <label>Polling Interval (sec)</label>
      <type>text</type>
    </input>
  </block>
</setup>

inputs.conf

[script://./bin/myscript.sh]
interval = 60
sourcetype = customsourcetype
source = customsource
disabled = 1

myscript.sh

#!/bin/sh
echo "Yay! You called me!"

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@manishmenon86

Can you please try this?

setup.xml

<setup>
  <block title="My Scripted Input" endpoint="data/inputs/script" entity=".%252Fbin%252Fmyscript.sh">
    <input field="interval">
      <label>Polling Interval (sec)</label>
      <type>text</type>
    </input>
  </block>
</setup>

inputs.conf

[script://./bin/myscript.sh]
interval = 60
sourcetype = customsourcetype
source = customsource
disabled = 1

myscript.sh

#!/bin/sh
echo "Yay! You called me!"
0 Karma

manishmenon86
New Member

Thank you so much. It worked. What needs to be done to ask the good folks at Splunk to update their documentation?

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...