SSH Template Parser icon

SSH Template Parser

Parse network device output using TextFSM templates. Extract structured data from SSH command outputs with pre-built templates for Aruba, Cisco, and other vendors.

Overview

The SSH Template Parser node is designed to parse unstructured text output from network devices (via SSH) into structured data using TextFSM templates. It supports multiple operations including parsing device output, creating new templates, uploading template JSON definitions, and managing existing templates.

This node is particularly useful in network automation workflows where you need to extract meaningful information from raw command outputs of devices from vendors like Aruba, Cisco, Juniper, or generic devices. For example, it can convert the output of a "show interfaces" command into structured JSON records for further processing or reporting.

The Upload Template operation specifically allows users to upload a complete TextFSM template definition as JSON, which the node then stores for later use in parsing tasks.

Properties

Name Meaning
Template JSON The full TextFSM template definition provided as a JSON string. This defines how to parse device output.

Output

  • The node outputs an array with a single item containing a JSON object.
  • The JSON object includes:
    • ok: A boolean indicating if the upload was successful (true).
    • id: The unique identifier assigned to the uploaded template.
    • name: The name of the uploaded template.

Example output JSON structure:

[
  {
    "json": {
      "ok": true,
      "id": "template-unique-id",
      "name": "Template Name"
    }
  }
]

No binary data output is produced by this operation.

Dependencies

  • Requires access to the internal Template Manager service that handles storing and retrieving TextFSM templates.
  • No external API keys or credentials are needed specifically for the upload operation.
  • The node depends on the TextFSM engine implementation bundled within the node's codebase.
  • No special environment variables or n8n configurations are required beyond standard node setup.

Troubleshooting

  • Invalid JSON Error: If the provided Template JSON is not valid JSON syntax, the node will throw an error:
    "Invalid JSON: <error message>"
    Resolution: Ensure the template JSON is correctly formatted before uploading.

  • Template Storage Issues: If the node cannot store the template due to internal errors, it may throw a generic operation error.
    Resolution: Check the node logs and ensure the Template Manager is properly initialized and has write permissions.

  • Unsupported Operation: If the operation parameter is set incorrectly, the node throws:
    "Unsupported operation: <operation>"
    Resolution: Verify that the operation is set to "uploadTemplate" for this use case.

Links and References

Discussion