cdougall_14195
Jul 12, 2016Cirrus
Solved
Datagroup audit through VIP
Long and short is that we have an external address datagroup that we interrogate from a VIP for auditing.
Datagroup:
host x.x.x.x := "blah",
network y.y.y.0/20 := "blah blah,",
host z.z.z.z := "blah blah blah",
Rule:
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
"/auditurl" {
HTTP::respond 200 content "[string map { " " "\n" } [class names penaltybox-dg]]" Cache-Control "no-cache,no-store" Content-Type "text/plain"
}
This does a good job of dumping out all of the records in the datagroup, but is not an easy thing to filter OUT the host entries. It's a pretty easy to apply a filter to "class name" to include something, but have had a hard time figuring out a way to EXCLUDE something.
x.x.x.x/32
y.y.y.0/20
z.z.z.z/32
Is there a way to filter out all of the host entries, so no more "/32"s in the listing? Any help would be appreciated. Thanks all.
Cameron
try something like
[string map { " " "\n" } [lsearch -all -inline -not [class name penaltybox-dg] */32]]