Resource Filtering
Resource filtering feature selectively exports telemetry data from specific network device components. This reduces bandwidth usage and processing time.
On a fully loaded network device with thousands of IFLs and IFDs, getting data for all IFLs and IFDs can take several attempts and use a lot of bandwidth. Resource filtering lets a collector choose only the data it needs from a specific resource. This feature supports XPATH based resource filtering for AFT platforms and REGEX based filtering for PFE sensors on Junos microkernel.
Benefits of Resource Filtering
-
You can select or reject specific instances of a resource, such as a key. This can include data from a particular IFL/IFD or all IFLs/IFDs.
-
You can use a wildcard option to selectively choose resources for an element.
Types of Resource Filtering
-
XPATH-based filtering- XPATH based filtering uses a key field or wildcard of one or more paths. The following options are supported in the XPATH based resource filtering:
-
Precise path or keys. Example:
/interfaces/interface[name=xe-0/0/0]
-
Full wildcard of keys. Example:
/interfaces/interface[name=*]
-
Partial wildcard of keys. Example:
/interfaces/interface[name=xe-0/0/*]
-
Multi-level key options. i.e., data pertaining to a particular IFL or an IFD.
-
-
REGEX-based filtering- REGEX filtering uses only a key field. There are many options of selecting a key, such as:
-
Precise path
xe-0/0/0
-
Starts with
xe-0/*
-
Ends with
*/0/0
-
Not a particular interface
!xe-0/0/0
-
-
XPATH-based resource filtering is not applicable to UDP mode of transport.
-
gNMI resource filtering and wild card filtering options are not applicable for firewall configuration path
/junos/system/linecard/firewall
, as there is no way to pass resource filter information in the path.
Example Configurations from a Collector
- Precise path or key such as
/interfaces/interface[name=xe-0/0/0
:An example configuration for a precise path or a key is given below for gRPC:
{ "dut_list": [ { "ip": "ferrari-mx02", "port":50051, "session_log":"grpc.session", "log_head":"grpc.data", "oc_rpc" : ["subscribe"], "subscribe": { "path_list": [{ "path":"/interfaces/interface[name='et-0/0/0']", "filter":"", "sample_frequency":2000, "suppress_unchanged":"", "max_silent_interval":0}], "input":{"collector_list":[{"address":"13.1.1.1"}]}, "additional_config":{"limit_records":1, "limit_time_seconds":1} } } ] }
- Full wildcard of keys such as
/interfaces/interface
A sample configuration for a wildcard of keys is given below for gRPC:
{ "dut_list": [ { "ip": " ferrari-mx02", "port":50051, "session_log":"grpc.session", "log_head":"grpc.data", "oc_rpc" : ["subscribe"], "subscribe": { "path_list": [{ "path":"/interfaces/interface/", "filter":"", "sample_frequency":2000, "suppress_unchanged":"", "max_silent_interval":0}], "input":{"collector_list":[{"address":"13.1.1.1"}]}, "additional_config":{"limit_records":1, "limit_time_seconds":1} } } ] }
- Partial wildcard of a key such as
/interfaces/interface[name='et-0/0/*']
A sample configuration for a partial wildcard of path is given below:
{ "dut_list": [ { "ip": "ferrari-mx02", "port":50051, "session_log":"grpc.session", "log_head":"grpc.data", "oc_rpc" : ["subscribe"], "subscribe": { "path_list": [{ "path":"/interfaces/interface[name='et-0/0/*'] ", "filter":"", "sample_frequency":2000, "suppress_unchanged":"", "max_silent_interval":0}], "input":{"collector_list":[{"address":"13.1.1.1"}]}, "additional_config":{"limit_records":1, "limit_time_seconds":1} } } ] }
- gNMI Configuration
A sample gNMI configuration is as shown below:
{ "host": "gamoral-intf-mtt1-c", "user": "regress", "password": "MaRtInI", "port": 50051, "cid": "cid-45", "gnmi": { "mode": 0, "encoding": 2 }, "grpc": { "ws": 1048576 }, "paths": [ { "path": "/interfaces/interface[name='et-0/0/31']/", "freq": 2000000000, "gnmi_submode": 2 } ] }
- Firewall related such as a precise key filter":"__default_arp_policer__"
As this is a Junos path, use the
filter
option in the Json file.{ "dut_list": [ { "ip": "ferrari-mx01", "port":50051, "session_log":"session.healthz_modify", "log_head":"data.ferrari_mx01", "oc_rpc" : ["subscribe"], "subscribe": { "path_list": [{ "path":"/junos/system/linecard/firewall/", "filter":"__default_arp_policer__", "sample_frequency":2000, "suppress_unchanged":"", "max_silent_interval":0}], "input":{"collector_list":[{"address":"10.213.2.16", "port":50051}]}, "additional_config":{"limit_records":1, "limit_time_seconds":1, "need_eos": 1} } } ] }
- Firewall related such as a partial wildcard key filter":"__default_arp_*"
A sample configuration is as below:
{ "dut_list": [ { "ip": "ferrari-mx01", "port":50051, "session_log":"session.healthz_modify", "log_head":"data.ferrari_mx01", "oc_rpc" : ["subscribe"], "subscribe": { "path_list": [{ "path":"/junos/system/linecard/firewall/", "filter":"__default_arp_*", "sample_frequency":2000, "suppress_unchanged":"", "max_silent_interval":0}], "input":{"collector_list":[{"address":"10.213.2.16", "port":50051}]}, "additional_config":{"limit_records":1, "limit_time_seconds":1, "need_eos": 1} } } ] }
- Firewall related such as no filter ---- filter":""
In this case, data pertaining to all keys are exported.
{ "dut_list": [ { "ip": "ferrari-mx01", "port":50051, "session_log":"session.healthz_modify", "log_head":"data.ferrari_mx01", "oc_rpc" : ["subscribe"], "subscribe": { "path_list": [{ "path":"/junos/system/linecard/firewall/", "filter":"", "sample_frequency":10000, "suppress_unchanged":"", "max_silent_interval":0}], "input":{"collector_list":[{"address":"10.213.2.16", "port":50051}]}, "additional_config":{"limit_records":1, "limit_time_seconds":1, "need_eos": 1} } } ] }