SSH Template Parser
Overview
The SSH Template Parser node is designed to parse unstructured text output from network devices (e.g., Aruba, Cisco, Juniper) using TextFSM templates. It transforms raw SSH command outputs into structured JSON data, enabling easier automation and analysis of device information.
This node supports multiple operations including parsing device output with existing templates, creating new templates, uploading templates as JSON, and managing stored templates (listing or deleting).
Common scenarios:
- Extracting interface status, routing tables, or configuration details from network devices.
- Automating network audits by converting CLI outputs into structured data.
- Managing a library of parsing templates for different vendors and commands.
Example:
You run a "show interfaces" command on a Cisco router via SSH, then use this node to parse the output with a Cisco-specific template, resulting in JSON records listing each interface's status and statistics.
Properties
| Name | Meaning |
|---|---|
| Action | Choose between "List" or "Delete" templates when managing templates. |
| Template to Delete | The ID of the template to delete (used only if Action is "Delete"). |
Additional relevant properties for the "Manage Templates" operation (not requested but present in code):
| Name | Meaning |
|---|---|
| Operation | Selects the node operation; here it must be "Manage Templates". |
Output
For the Manage Templates operation:
List action: Outputs an array of template objects, each containing metadata such as vendor, name, command, and ID.
Example output item:
{ "vendor": "cisco", "name": "show interfaces", "command": "show interfaces", "id": "template-id-123" }Delete action: Outputs a confirmation object indicating success and the ID of the deleted template.
Example output:
{ "ok": true, "deleted": "template-id-123" }
No binary data output is involved in this operation.
Dependencies
- Requires access to a Template Manager service that handles storage, retrieval, and deletion of TextFSM templates.
- Uses a TextFSM Engine internally for parsing templates (though not directly used in Manage Templates operation).
- No external API keys or credentials are needed specifically for managing templates.
- The node depends on n8n's environment for storing templates persistently.
Troubleshooting
Error: Unsupported operation
Occurs if the operation parameter is set to something other than the supported ones. Ensure "Manage Templates" is selected for this context.Error: Template not found
Not applicable here since this operation does not require a specific template ID except for deletion. For deletion, ensure the provided template ID exists.Deleting a non-existent template
If you attempt to delete a template ID that does not exist, the node may throw an error or silently fail depending on the Template Manager implementation. Verify template IDs by listing before deleting.Empty list result
If no templates are stored or match filters, the list action will return an empty array.
Links and References
- TextFSM GitHub Repository – underlying template parsing engine concept.
- n8n Documentation – general info on custom nodes and workflows.
- Network Automation with TextFSM – tutorial on using TextFSM for network device output parsing.