Getting Data In

Modular input validation Introspection

bmacias84
Champion

Hello, I can't seem to get my validation using match. Hoping some one can tell me what I am doing wrong or missing.


<arg name="name">
<title>Device Name or IP</title>
<description>FQDN or IP Address. For example, 10.1.173.1 or INTFW-ASA700-vc.MYDomain.net.
</description>
<validation>
validate(match('name', '^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$'), "Device Name or IP: invalid DNS or IP")
</validation>
</arg>

Thanks in advance

1 Solution

jguarini
Path Finder

try this

(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)

gladly taken from
http://stackoverflow.com/questions/4011855/regexp-to-check-if-an-ip-is-valid

View solution in original post

jguarini
Path Finder

try this

(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)

gladly taken from
http://stackoverflow.com/questions/4011855/regexp-to-check-if-an-ip-is-valid

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...