All Apps and Add-ons

How can I validate a data input parameter

sporcello
New Member

I am using the Splunk add-on builder, and I am trying to validate the value of a data input parameter when the user enters a value. For example, if the parameter is supposed to be an integer and the user enters a string, I would like to prompt the user and let them know it is an invalid parameter value and needs to be an integer. (Similar to entering a string in the 'Interval' parameter for any new input type as shown in the screenshot).

Edit: Answered my own question... I wasn't able to find this in the add-on builder, however I was able to edit two files in the app that can provide the functionality: /etc/apps//appserver/static/js/build/globalConfig.json and/or /etc/apps//bin/rh.py

Both files allow you edit a "validator" section for the parameters, and allows for configuring a regex pattern for matching and an error message for non-matches. Then when creating a new input in the app, the field value is checked against the regex pattern and if it doesn't match there is a error message like the one in the screenshot below.

alt text

0 Karma
Get Updates on the Splunk Community!

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...