Parsing Text using TTP

Before we dive into TTP (Template Text Parser), let us first address why we need a text scraping tool in the modern world of APIs and structured data. Here is my opinion:
- Many organisations still use legacy devices that do not have APIs or structured data formats embedded in their CLI.
- Network devices are still evolving and not all devices have APIs that are easy to work with.
- There is more information in the output of a command than what is available through the API.
- Network Engineers are used to working with CLI and screen scraping is a natural extension of this workflow.
- Sometimes you just need to get some data quickly and writing a full-fledged API client is not worth the effort.
You would be surprised to know that many commercial tools that do network observability use screen scraping under the hood. So, it is not a bad idea to learn how to do it yourself.
What are our options?
From a network engineer's perspective, there are two popular tools that can be used for screen scraping:
- TextFSM - TextFSM is a mature tool that has been around for a long time with huge community support and a large Continue reading




