Filtering Data using XPATH
Configure MDT using the answer from the previous lab, if it is not already configured.
Change the sensor-path so that only data about gi0/0/0/0.100 is exported.
Answer
Explanation
By using XPath filtering techniques, we can limit the output of the streamed data directly at the sensor-path level. In this lab, we limit the particular interface by using the following syntax:
How did we know to use “interface-name” and not “interface” or “if-name” etc? We can check the raw output of the MDT data by using run mdt_exec -s <sensor-path>
Above, this is of course hard to read. Additionally, you cannot use pipe filters such as |include or |grep. One alternative might be to copy the output to notepad and do a search for "keys". Another idea is to use python (run python from exec mode on IOS-XR) and use pprint to pprint the output.
We can then test that our filter works by using the same command again. Notice that we now only get data about the single interface:
Now in grafana I only see data for this one interface:
Last updated