Forum Discussion
John_Masgalas_4
Nimbostratus
Jan 30, 2009iRule modification - rdp
I currently use the below iRule with our Terminal Services pool. It strips everything after the "@" in the username so that the persistence entry is only the username. I would like to modify it so tha...
hoolio
Cirrostratus
Feb 06, 2009Thanks for that.
If the original string has two backslashes, then you'd need to use four for getfield. The first and third slashes escape the second and fourth.
[getfield $msrdp "\\\\" 2]
You could try something like this which assumes that the msrdp string won't have both an @ and backslashes. It also handles one backslash:
if { $msrdp contains "@" } {
log local0. "Data Persisting on: [getfield $msrdp "@" 1]"
persist uie [getfield $msrdp "@" 1] 10800
} elseif { $msrdp contains "\\\\" } {
log local0. "Data Persisting on: [getfield $msrdp "\\\\" 2]"
persist uie [getfield $msrdp "\\\\" 2] 10800
} elseif { $msrdp contains "\\" } {
log local0. "Data Persisting on: [getfield $msrdp "\\" 2]"
persist uie [getfield $msrdp "\\" 2] 10800
} else {
persist uie $msrdp 10800
log local0. "Data Persisting on: $msrdp"
}
}
Aaron
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