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!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...