Getting Data In

Modular Input: Do we need to parse a "name" stanza if I have defined in my spec that my named stanza is default?

jhernandez_splu
Splunk Employee
Splunk Employee

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?

1 Solution

jhernandez_splu
Splunk Employee
Splunk Employee

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>

View solution in original post

jhernandez_splu
Splunk Employee
Splunk Employee

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>

jhernandez_splu
Splunk Employee
Splunk Employee
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 ...