SSH Template Parser
Overview
The SSH Template Parser node is designed to parse unstructured text output from network devices (such as Aruba, Cisco, Juniper, and generic vendors) using TextFSM templates. It extracts structured data from SSH command outputs by applying pre-built or custom parsing templates. This node is particularly useful in network automation workflows where device CLI outputs need to be converted into structured JSON for further processing, reporting, or integration.
Common scenarios:
- Parsing interface status or routing table outputs from network devices.
- Extracting configuration details or logs from device command outputs.
- Automating network audits by converting raw CLI outputs into structured data.
- Integrating parsed network data with monitoring or ticketing systems.
Practical example:
You run a "show interfaces" command on a Cisco router via SSH, capture the raw text output, and use this node with a Cisco-specific template to parse the output into JSON records representing each interface's status, speed, and errors.
Properties
| Name | Meaning |
|---|---|
| Vendor Filter | Filter available parsing templates by vendor. Options: Any, Aruba, Cisco, Juniper, Generic. |
| Command Contains | Filter templates by substring contained in the command they parse. |
| Template | Select the specific parsing template to use. Templates are loaded dynamically based on filters. |
| Output Mode | Choose how parsed results are output: - Single Item (records array): all records in one item. - Split Items (one per record): each record as separate item. |
| Text Source | Source of the input text to parse: - Input Field: take text from a named field in incoming JSON. - JSON Path: extract text using a dot notation path. - String: use a static string input. |
| Field Name | Name of the input field containing text to parse (used if Text Source = Input Field). Default: "data". |
| Field Path (dot notation) | Dot notation path to extract text from input JSON (used if Text Source = JSON Path). Default: "data.output". |
| Input Text | Static multiline string input to parse (used if Text Source = String). |
| Enable Debug Trace | Enable debug tracing during parsing for troubleshooting purposes. |
| Fail if No Match | Throw an error if parsing yields zero records. Useful to catch unexpected input or template mismatches. |
| Reset Fields On Emit | Disable filldown behavior by resetting fields on each emitted record. |
| Coerce Variable Types | Use variable type information from the template to coerce parsed values into appropriate types (e.g., numbers instead of strings). |
Output
The node outputs parsed data as JSON objects:
- When Output Mode is "Single Item", the output JSON contains a single property
resultwhich holds an array of parsed records. - When Output Mode is "Split Items", each parsed record is output as a separate item with its own JSON object.
Each record corresponds to one parsed entry extracted from the device output according to the selected TextFSM template.
The node does not output binary data.
Dependencies
- Requires pre-existing or user-created TextFSM templates stored and managed internally.
- Uses a Template Manager component to load, create, upload, list, and delete templates.
- The parsing engine is based on a TextFSM implementation adapted for n8n.
- No external API keys or services are required; all parsing is done locally within the node.
Troubleshooting
- Template Not Found Error: If the selected template ID does not exist, the node throws an error. Ensure the template is uploaded or created beforehand.
- No Records Parsed: If no records match the input text and
Fail if No Matchis enabled, the node throws an error. Check that the input text matches the expected format of the template. - Invalid JSON in Template Creation/Upload: When creating or uploading templates via JSON, invalid JSON syntax will cause an error. Validate JSON before submission.
- Empty or Incorrect Input Text: If the input text source is misconfigured (wrong field name or JSON path), parsing will fail or yield no results. Verify input paths and sources.
- Debugging: Enable the debug trace option to get detailed parsing logs which can help identify why parsing fails or produces unexpected results.
Links and References
- TextFSM GitHub Repository – Original TextFSM project for understanding template syntax.
- n8n Documentation – For general guidance on creating and using custom nodes.
- Network device CLI references for Aruba, Cisco, Juniper commands to understand expected output formats.