-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not Able to Display Policy Lookup #14
Comments
Remove tag before jcs:printf(…) Thanks, From: manjitlazada Hello All Can somebody Please help in correcting the issue I am running this below Script but not getting lookup output SCRIPT: version 10; ns junos = "http://xmljunipernet/junos/*/junos"; match / { { var $cmd = "show security policies detail"; /* get policy hit count */ var $formatFields = "%20-s%20-s%20-s%20-s%20-s%20-s%20-s"; /* format for column headers display / jcs:printf($formatFields,"Policy name","Source Zone","Destination Zone","Source Address", "Destination Address","Application"," Policy Lookups"); for-each($out/security-context/policies/policy-information) { /* get all policy info such as name, source address, destination address, zone, application and * count
} /* end of foreach */ } /* End of op script results */ } /* End of match / */ template returnMax ($maxString="Nothing specified") { /* Return the max number in a string of numbers */ {
} } template returnArrayCount ($array="Nothing defined") { /*return the size of an array */
} template create-loop-counter( $counter ) { if( $counter > 0 ) {
} } — |
You mean the whole statement ? that will delete the formatting. error: error: /var/db/scripts/op/policylookups.slax: 1 error detected during parsing error: error reading stylesheet: policylookups.slax error: /var/db/scripts/op/policylookups.slax:22: error: /var/db/scripts/op/policylookups.slax:21: parse error, unexpected T_FUNCTION_NAME before 'jcs:printf': |
It will be good if you can share the setup . Thanks, From: manjitlazada You mean the whole statement ? that will delete the formatting. error: error: /var/db/scripts/op/policylookups.slax: 1 error detected during parsing error: error reading stylesheet: policylookups.slax error: /var/db/scripts/op/policylookups.slax:22: error: /var/db/scripts/op/policylookups.slax:21: parse error, unexpected T_FUNCTION_NAME before 'jcs:printf': — |
The Setup is simple. I have an SRX on which I have multiple security policies running and I want to collect all policy inofmration/ terms in a one go. If a Security Policy contains multiple policies then that should also be captured. |
Hello All
Can somebody Please help in correcting the issue. I am running this below Script but not getting lookup output.
SCRIPT:
version 1.0;
ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
ns ext = "http://xmlsoft.org/XSLT/namespace";
match / {
for-each($out/security-context/policies/policy-information) { /* get all policy info such as name, source address, destination address, zone, application and * count
*/
} /* End of op script results */
} /* End of match / */
template returnMax ($maxString="Nothing specified") { /* Return the max number in a string of numbers */
}
template returnArrayCount ($array="Nothing defined") { /*return the size of an array */
}
template create-loop-counter( $counter ) {
}
The text was updated successfully, but these errors were encountered: