Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Filter Operational Command Output for Specific Child Tags of an Object in NETCONF and Junos XML Protocol Sessions

In a NETCONF or Junos XML protocol session with a device running Junos OS, a client application can request operational information for the device and filter the output to select for child elements of a specific object. To filter the operational command output to return specific child elements, a client application emits an RPC request for operational information and includes a <filter type="subtree"> tag element that encloses the tag elements representing all levels in the operational command output hierarchy from the root element down to the immediate parent level for the object.

To represent the requested instance of the object, the application emits its container tag element and also includes its identifier using the <name> tag element or equivalent identifier element for objects that do not use <name> as an identifier. To select specific child tags, the client application emits all desired child tag elements and descendents.

The server returns the requested object and child elements in the RPC reply.

The following example requests information for the show route command, which corresponds to the <get-route-information> RPC request tag. The client application filters the operational command output to return only the <active-tag> and <nh> elements for the <rt> object in the inet.0 table that has identifier

The RPC reply from the server includes only the <rt> element and child elements that were requested.