F5 iRule to get data group address content values list
Hi
I am following this article for creating a data group on F5, populated from Azure IPv4 addresses.
Eveyrthing works like a charm, and now I am trying to publish the content of that data group as an html web page, but I want the output to be formulated like:
13.8.1.0/24
13.9.0.0/16
18.5.0.0/16
etc.
So it has to be presented as a list with line breaks for each entry.
Right now I am using this iRule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/azure.html" {
# Retrieve the Azure datagroup contents, send it in a HTTP 200 response
HTTP::respond 200 content [class get azure_ipv4_dg] "Content-Type" "text/html"
}
default {
## requested something else
HTTP::respond 404 content "Oops! You've asked for something we don't have."
}
}
}
The output though comes like this:
{102.133.0.0/18 {}} {102.133.112.0/28 {}} {102.133.120.0/21 {}} {102.133.128.0/18 {}} {102.133.192.0/19 {}} {102.133.224.0/20 {}} {102.133.240.0/25 {}} {102.133.240.128/26 {}} {102.133.248.0/21 {}} {102.133.64.0/19 {}} {102.133.96.0/20 {}} {102.37.0.0/20 {}} {102.37.128.0/19 {}} {102.37.16.0/21 {}} {102.37.160.0/21 {}} {102.37.192.0/18 {}} {102.37.24.0/23 {}} {102.37.26.0/27 {}} {102.37.26.32/27 {}} {102.37.32.0/19 {}}
Is there an easy way to formulate the data to be more like a list, with line breaks, and without the brackets?
Thank you in advance for any suggestions.