I have been working on a modular input and been struggling with the way you read input stanza data from splunk
all examples for some reason parse a "name" stanza before actually getting any values back from the defined spec.
http://docs.splunk.com/Documentation/Splunk/6.2.0/AdvancedDev/ModInputsScripts#Read_XML_configuratio...
do we need to parse this name stanza even if I have defined in my spec that my named stanza is default? Is it required?
Referring specifically to this piece:
if conf_node:
logging.debug("XML: found configuration")
stanza = conf_node.getElementsByTagName("stanza")[0]
if stanza:
stanza_name = stanza.getAttribute("name")
if stanza_name:
logging.debug("XML: found stanza " + stanza_name)
config["name"] = stanza_name
Is there another recommended way of reading that stanza back from Splunk?
So after further troubleshooting the name stanza is required to be parsed in the config. It is also required to be sent via the default/data/ui/manager/*.xml if you are configuring via the UI http://docs.splunk.com/Documentation/Splunk/6.2.0/AdvancedDev/ModInputsCustomizeUI#Manager_page_exam...
Example:
<element name="name" label="Input name">
<view name="list"/>
<view name="create"/>
<key name="exampleText">Just a name to identify this modular input. Example: default</key>
So after further troubleshooting the name stanza is required to be parsed in the config. It is also required to be sent via the default/data/ui/manager/*.xml if you are configuring via the UI http://docs.splunk.com/Documentation/Splunk/6.2.0/AdvancedDev/ModInputsCustomizeUI#Manager_page_exam...
Example:
<element name="name" label="Input name">
<view name="list"/>
<view name="create"/>
<key name="exampleText">Just a name to identify this modular input. Example: default</key>
In testing I got a very obscure error:
https://www.evernote.com/shard/s237/sh/eef0807b-e8ae-4e60-9ab5-7f86356f86d1/a34f5708f4f7dce712f429c5...
In search internal logs this shows up:
https://www.evernote.com/shard/s237/sh/43000d68-97dc-434c-9522-a3b9c0c61205/7b538ae4851c496307dd9ee3...
I confirmed that the REST endpoint does work and I can create a new modular input entry:
https://www.evernote.com/shard/s237/sh/da844c07-adea-482f-bd46-d37cbd86218f/9429a8205501a15b019212bd...