All Apps and Add-ons

Cannot choose from multiple data collectors in Splunk Add-On Builder

ohbuckeyeio
Communicator

Hello,

I have a TA developed through the Splunk Add-On builder that has two different data collections configured. If I create an input instance, it only runs the first data collector that was added.  Both inputs have different fields available to them, so that doesn't really help, plus they need to run on different intervals.

How do we configured the TA to allow for different input configurations based on a selectable input name?

Thanks.

Labels (1)
0 Karma
1 Solution

ohbuckeyeio
Communicator

I worked my way around this with checkboxes and inputs stanzas.  If box one is checked, run mydef1, etc...  Was hoping there was a built-in way of doing this with the TA's Input button.  This let me have one Input with different ways of running it.

stanzas = helper.input_stanzas
for stanza in stanzas:
     if helper.get_arg('input_name1', helper.get_input_stanza_names()) == True:
          from modinputs.mymodule1 import mydef1
          mydef1(helper,ew,ta_name,data)

     if helper.get_arg('input_name2', helper.get_input_stanza_names()) == True:
          from modinputs.mymodule2 import mydef2
          mydef2(helper,ew,ta_name,data)

 

View solution in original post

0 Karma

ohbuckeyeio
Communicator

I worked my way around this with checkboxes and inputs stanzas.  If box one is checked, run mydef1, etc...  Was hoping there was a built-in way of doing this with the TA's Input button.  This let me have one Input with different ways of running it.

stanzas = helper.input_stanzas
for stanza in stanzas:
     if helper.get_arg('input_name1', helper.get_input_stanza_names()) == True:
          from modinputs.mymodule1 import mydef1
          mydef1(helper,ew,ta_name,data)

     if helper.get_arg('input_name2', helper.get_input_stanza_names()) == True:
          from modinputs.mymodule2 import mydef2
          mydef2(helper,ew,ta_name,data)

 

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...