Classes / Data Groups searching
This is on LTMs, v11.3...
Client URLs are of two possible forms: http://anyplace.com/streamX and http://anyplace.com/hls/streamX/playlist.m3u8
I've created a Data Group "streams" - the "String" values are all of the allowed streamX values; the "Value" values are the name of the pools that will handle that specific stream. E.g.:
String Value
news1 pool1
old-news pool2
story6b pool1
sport-nine pool1
sport9 pool2
...and so on (< 100 values)
So, from example 1 in the Data Group, we will see both of these URLs: http://anyplace.com/news1 and http://anyplace.com/hls/news1/playlist.m3u8.
Had been attempting to use findclass & 'contains' to generate an iRule that would let me parse the URL, and direct the client to the appropriate pool. Then I came across https://devcentral.f5.com/articles/v11-irules-data-group-updates and am now completely confused! Any pointers/help appreciated (there's very little in the way of real-world examples, for a mere mortal [such as myself], covering Classes/Data Groups in v11).
TIA, Jon
Rather than using scan, is it not less resource-hungry to do something like:
it seems you are right.
scan root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux ltm rule qux { timing on when HTTP_REQUEST { scan [HTTP::path] {/hls/%[^/]/playlist.m3u8} stream } } root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) show ltm rule qux raw (raw) --------------------------------- Ltm::Rule Event: qux:HTTP_REQUEST --------------------------------- Priority 500 Executions Total 500 Failures 0 Aborts 0 CPU Cycles on Executing Average 31477 Maximum 108708 Minimum 26020 getfield root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux ltm rule qux { timing on when HTTP_REQUEST { set test [getfield [HTTP::path] "/" 3] } } root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) show ltm rule qux raw (raw) --------------------------------- Ltm::Rule Event: qux:HTTP_REQUEST --------------------------------- Priority 500 Executions Total 500 Failures 0 Aborts 0 CPU Cycles on Executing Average 26278 Maximum 104980 Minimum 22000