Forum Discussion
lostinberlin_11
Nimbostratus
Jul 31, 2015Strange behaviour list traffic policies
...can anyone explain this?
Searching with a wild-card does not return the correct values (see actions and conditions)
P-policy-admi*
vs
P-policy-admin
root@(localhost)(cfg-sync In Sy...
Kevin_Stewart
Employee
Jul 31, 2015Ah, I see what you mean now. Yes, it does appear that the wildcard removes some actions and conditions information from the response.
[root@bigip116:Active:Standalone] config tmsh list /ltm policy policy-test
ltm policy policy-test {
controls { forwarding }
requires { http tcp }
rules {
foo-test {
actions {
0 {
http-reply
redirect
location /bar
}
}
conditions {
0 {
http-uri
starts-with
values { /foo }
}
}
ordinal 1
}
}
strategy first-match
}
[root@bigip116:Active:Standalone] config tmsh list /ltm policy policy-*
ltm policy policy-test {
controls { forwarding }
requires { http tcp }
rules {
foo-test {
ordinal 1
}
}
strategy first-match
}
Suffice it to say, good catch. 😉
I don't think that's intentional so please do open a support case. In the meantime, I can think of at least workaround:
tmsh list /ltm policy |grep -A 0 policy-.* | awk -F" " '{ print $3 }'
to list the names of all policies matching your string pattern, and then perhaps a loop:
for val in `tmsh list /ltm policy |grep -A 0 policy-.* | awk -F" " '{ print $3 }'`; do tmsh list /ltm policy $val; done
Not the prettiest thing in the world, but it should work.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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