All Apps and Add-ons

What's the best way of doing a dependency check in a modular input?

gf13579
Communicator

I'm using the AddOn Builder 2 to build a modular input based on a python script that wraps around an external command.

I want to do a dependency check - ideally as part of the UI used by the user to set the app up, rather than at runtime in collect_events or validate_input.

I want to check that a given binary is present on the system and advise the user to install it - if not already present. Any suggestions?

Bonus question: does validate_input actually get called when using the AddOn Builder to test a python script? I'm raising ValueError(...) but the AoB still successfully invokes collect_events regardless.

0 Karma
1 Solution

chli_splunk
Splunk Employee
Splunk Employee

You are right you can use validate_input() method. Just raise an exception like this:
raise Exception("error message")

Then the error will be shown in UI.

View solution in original post

chli_splunk
Splunk Employee
Splunk Employee

You are right you can use validate_input() method. Just raise an exception like this:
raise Exception("error message")

Then the error will be shown in UI.

gf13579
Communicator

I figured out that validate_input gets called when the user creates/updates an input (makes sense now) but there doesn't seem to be anyway to pass a useful message back to the user at that point - any tips?

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

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 ...