Forum Discussion
Log4j2
May 10, 2022Altocumulus
iRule [string range...] not chunking data properly
I have an irule (much of which I found here) that is to gather some much needed troubleshooting data I need in regards to the headers and payload I have coming in. The payload is obvisouly too large...
- May 11, 2022
In fact I have just grabbed this from an iRule i recently wrote. Almost the same, with fixed values. Note the end is 99 but the increment is 100. As you say, string range is zero-indexed
for {set start 0; set end 99} {$start < [HTTP::payload length]} {incr start 100;incr end 100} { log local0.debug "[string range [HTTP::payload] $start $end ]" }
PeteWhite
May 11, 2022Employee
How about somehting like this:
for { set start 0; set end $static::max_chars} { $start < [HTTP::payload length] } { incr start $static::max_chars; incr end $static::max_chars } {
log local0.debug "$start:$end [string range [HTTP::payload] $start $end]"
}
- PeteWhiteMay 11, 2022Employee
In fact I have just grabbed this from an iRule i recently wrote. Almost the same, with fixed values. Note the end is 99 but the increment is 100. As you say, string range is zero-indexed
for {set start 0; set end 99} {$start < [HTTP::payload length]} {incr start 100;incr end 100} { log local0.debug "[string range [HTTP::payload] $start $end ]" }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects