Forum Discussion
jonhd_205628
Jun 11, 2015Nimbostratus
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" v...
- Jun 12, 2015
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
nitass_89166
Jun 11, 2015Noctilucent
is it something like this?
configuration
root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 200.200.200.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 9
}
root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
set path [HTTP::path]
set stream ""
if { $path starts_with "/hls/" and $path ends_with "/playlist.m3u8" } {
if { [scan $path {/hls/%[^/]/playlist.m3u8} stream] != 1 } {
use default pool
return
}
} else {
if { [scan $path {/%[^/]} stream] != 1 } {
use default pool
return
}
}
if { [catch { pool [class match -value $stream equals stream_datagroup] }] } {
use default pool
}
}
when HTTP_RESPONSE {
log local0. "path: $path stream: $stream pool: [LB::server pool]"
}
}
root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm data-group internal stream_datagroup
ltm data-group internal stream_datagroup {
records {
news1 {
data pool1
}
}
type string
}
/var/log/ltm
[root@ve11c:Active:In Sync] config tail -f /var/log/ltm
Jun 11 21:31:21 ve11c info tmm1[10748]: Rule /Common/qux : path: / stream: pool: /Common/foo
Jun 11 21:31:27 ve11c info tmm[10748]: Rule /Common/qux : path: /something stream: something pool: /Common/foo
Jun 11 21:31:33 ve11c info tmm1[10748]: Rule /Common/qux : path: /news1 stream: news1 pool: /Common/pool1
Jun 11 21:31:46 ve11c info tmm[10748]: Rule /Common/qux : path: /hls/something/playlist.m3u8 stream: something pool: /Common/foo
Jun 11 21:31:54 ve11c info tmm1[10748]: Rule /Common/qux : path: /hls/news1/playlist.m3u8 stream: news1 pool: /Common/pool1
- jonhd_205628Jun 11, 2015NimbostratusKinda does, nitass, thanks. How does that 'play' with a 2nd entry in the Data Group of (say) "old-news" "pool2" (as per my example Data Group)?... Cheers, Jon
- nitass_89166Jun 11, 2015Noctilucentmultiple data group records should work too.
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