Forum Discussion
F5 iRule to get data group address content values list
I am now using two v. servers. The front one uses a stream profile and this iRule:
when HTTP_REQUEST {
HTTP::header remove Accept-Encoding
STREAM::disable
virtual vs_ipv4feed_client_http
return
}
when HTTP_RESPONSE {
set find " "
set replace "</br>"
STREAM::expression "@$find@$replace@"
STREAM::enable
}
The backend v. server (vs_ipv4feed_client_http) uses the iRule I pasted in the previous post as well.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/azureipv4.txt" {
# Retrieve the Azure datagroup contents, send it in a HTTP 200 response
HTTP::respond 200 content [class names azure_ipv4_dg] "Content-Type" "text/html"
}
}
}
The output looks like this now:
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
....
Which is what I wanted. However, if I look a the source code of this txt file within the browser, it looks like this:
102.133.0.0/18</br>102.133.112.0/28</br>102.133.120.0/21</br>102.133.128.0/18</br>102.133.192.0/19</br>102.133.224.0/20</br>102.133.240.0/25</br>102.133.240.128/26</br>102.133.248.0/21</br>102.133.64.0/19</br>102.133.96.0/20</br>102.37.0.0/20</br>102.37.128.0/19</br>.......
My problem is that the firewall that I need to feed this list within, expects a native txt file with line breaks, rather than an html based txt file which uses "</br>". Therefore, I am unable to feed those IPs into my firewall, unless I somehow present this txt file as a native txt.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com