elasticsearch/docs/reference/query-languages/esql/_snippets/functions
Nik Everett 55a6624746
ESQL: TO_IP can handle leading zeros (#126532)
Modifies TO_IP so it can handle leading `0`s in ipv4s. Here's how it
works now:
```
ROW ip = TO_IP("192.168.0.1") // OK!
ROW ip = TO_IP("192.168.010.1") // Fails
```

This adds
```
ROW ip = TO_IP("192.168.010.1", {"leading_zeros": "octal"})
ROW ip = TO_IP("192.168.010.1", {"leading_zeros": "decimal"})
```

We do this because there isn't a consensus on how to parse leading zeros
in ipv4s. The standard unix tools like `ping` and `ftp` interpret
leading zeros as octal. Java's built in ip parsing interprets them as
decimal. Because folks are using this for security rules we need to
support all the choices.

Closes #125460
2025-04-11 19:45:14 +02:00
..
appendix [docs] Prepare for docs-assembler (#125118) 2025-03-20 12:09:12 -05:00
description ESQL: Split grouping functions based on their EVAL-ability (#126597) 2025-04-11 16:19:54 +02:00
examples ESQL: TO_IP can handle leading zeros (#126532) 2025-04-11 19:45:14 +02:00
functionNamedParams ESQL: TO_IP can handle leading zeros (#126532) 2025-04-11 19:45:14 +02:00
layout ESQL: TO_IP can handle leading zeros (#126532) 2025-04-11 19:45:14 +02:00
parameters ESQL: TO_IP can handle leading zeros (#126532) 2025-04-11 19:45:14 +02:00
types ESQL: TO_IP can handle leading zeros (#126532) 2025-04-11 19:45:14 +02:00