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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...