Policy Operational Commands
Viewing Policy Server Statistics
The show policy statistics policy-server command lets you view detailed policy statistics on the policy server. The filter options let you specify a particular policy or client context to view detailed statistics, including configuration time, compile time, compilation status, and client-context subscription details.
Syntax:
| Option | Description |
|---|---|
|
Displays detailed information for the policy server. |
|
Specifies the name of the brick daemon. For example, bgp.appd.1 |
|
Specifies the application-specific policy context. |
|
Displays detailed statistics for all policies on the policy server. |
|
Displays statistics for a specific policy. |
|
Displays detailed statistics for a specific policy. |
|
Displays statistics for a specific client-context. |
|
Displays detailed statistics for a specific client-context. |
The example below shows the statistics for all policies on the policy server.
supervisor@rtbrick.net: cfg> show policy statistics policy-server Policy Code Generation Statistics: Policy Name: v4_labeled_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:20 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compilation Status : success Policy Name: v4_mvpn Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:14 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:14 GMT +0000 2026 Compilation Status : success Policy Name: v4_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compilation Status : success Policy Name: v4_vrf_blue_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:22 GMT +0000 2026 Compilation Status : success Policy Name: v6_labeled_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:22 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:23 GMT +0000 2026 Compilation Status : success Policy Name: v6_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:23 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:24 GMT +0000 2026 Compilation Status : success <...>
The example below shows the detailed statistics for all policies on the policy server, including the path to the compiled policy library.
supervisor@rtbrick.net: cfg> show policy statistics policy-server detail Policy Code Generation Statistics: Policy Name: v4_labeled_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:20 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compilation Status : success Path : /usr/share/rtbrick/libpolicy/libs/v4_labeled_unicast_prefixs.so Policy Name: v4_mvpn Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:14 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:14 GMT +0000 2026 Compilation Status : success Path : /usr/share/rtbrick/libpolicy/libs/v4_mvpn.so Policy Name: v4_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compilation Status : success Path : /usr/share/rtbrick/libpolicy/libs/v4_unicast_prefixs.so Policy Name: v4_vrf_blue_unicast_prefixs Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026 Compile Start Time : Tue Apr 28 07:13:21 GMT +0000 2026 Compile End Time : Tue Apr 28 07:13:22 GMT +0000 2026 Compilation Status : success Path : /usr/share/rtbrick/libpolicy/libs/v4_vrf_blue_unicast_prefixs.so <...>
The example below shows the detailed statistics for a specific policy daemon, including client-context subscription details.
supervisor@rtbrick.net: cfg> show policy statistics policy-server bgp.appd.1
Policy Code Generation Statistics:
Policy Name: v4_labeled_unicast_prefixs
Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026
Compile Start Time : Tue Apr 28 07:13:20 GMT +0000 2026
Compile End Time : Tue Apr 28 07:13:21 GMT +0000 2026
Compilation Status : success
Client-contexts:
Client-context : export.default.PE2.ipv4.labeled-unicast
Subscription Time : Tue Apr 28 07:13:10 GMT +0000 2026
Notification Time : Tue Apr 28 07:13:24 GMT +0000 2026
Policy Name: v4_unicast_prefixs
Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026
Compile Start Time : Tue Apr 28 07:13:21 GMT +0000 2026
Compile End Time : Tue Apr 28 07:13:21 GMT +0000 2026
Compilation Status : success
Client-contexts:
Client-context : export.default.PE2.ipv4.unicast
Subscription Time : Tue Apr 28 07:13:10 GMT +0000 2026
Notification Time : Tue Apr 28 07:13:24 GMT +0000 2026
Policy Name: v6_labeled_unicast_prefixs
Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026
Compile Start Time : Tue Apr 28 07:13:22 GMT +0000 2026
Compile End Time : Tue Apr 28 07:13:23 GMT +0000 2026
Compilation Status : success
Client-contexts:
Client-context : export.default.PE2.ipv6.labeled-unicast
Subscription Time : Tue Apr 28 07:13:10 GMT +0000 2026
Notification Time : Tue Apr 28 07:13:24 GMT +0000 2026
The example below shows the detailed statistics for a specific policy and client-context, including subscription and notification times.
supervisor@rtbrick.net: cfg> show policy statistics policy-server bgp.appd.1 policy-name v4_labeled_unicast_prefixs
Policy Code Generation Statistics:
Policy Name: v4_labeled_unicast_prefixs
Configuration Time : Tue Apr 28 07:13:10 GMT +0000 2026
Compile Start Time : Tue Apr 28 07:13:20 GMT +0000 2026
Compile End Time : Tue Apr 28 07:13:21 GMT +0000 2026
Compilation Status : success
Client-contexts:
Client-context : export.default.PE2.ipv4.labeled-unicast
Subscription Time : Tue Apr 28 07:13:10 GMT +0000 2026
Notification Time : Tue Apr 28 07:13:24 GMT +0000 2026
Policy Clear Commands
Clearing Policy Statistics
The clear policy statistics command removes statistics data for specified brick daemons, application keys, or policies.
Syntax:
| Option | Description |
|---|---|
|
Specifies the name of the brick daemon. For example, bgp.appd.1 |
|
Specifies the application-specific policy context. |
|
Specifies the name of the policy. |
The following example shows how to clear the statistics for a specific policy on the policy server:
supervisor@rtbrick.net: cfg> clear policy statistics policy-server policy-name BGP_EXPORT_POLICY
Policy Test
You can use the policy test feature to test a policy before attaching it to a protocol or an instance.
Perform the following tasks:
-
Step 1: Identify the brick daemon that will process the policy and the table to which the policy will be applied.
-
Step 2: Execute the 'test policy run' command.
Example: Testing a BGP VPN export policy
supervisor@leaf1: op> test policy run bgp.appd.1 policy-name VPN_V4_EXPORT table default.bgp.rib-in.import.ipv4.vpn-unicast
-
Step 3: View the test results.
The policy test feature will create two result tables. The result table ending with ".policy.permit" will show all objects permitted by the policy, the one ending with ".policy.deny" will show all objects denied by the policy.
Example: Viewing the result tables
supervisor@leaf1: op> show datastore bgp.appd.1 table default.bgp.rib-in.import.ipv4.vpn-unicast.policy.permit <...> supervisor@leaf1: op> show datastore bgp.appd.1 table default.bgp.rib-in.import.ipv4.vpn-unicast.policy.deny <...>
-
Step 4: Clear the result tables
You can clear the result tables using the 'test policy clear' command. Apply the clear command to the same table for which you have run the policy test.
Example: Clearing the result tables
supervisor@leaf1: op> test policy clear bgp.appd.1 policy-name VPN_V4_EXPORT table default.bgp.rib-in.import.ipv4.vpn-unicast