ntc-templates icon indicating copy to clipboard operation
ntc-templates copied to clipboard

cisco_ios_show_alert_counters fails to parse empty space in front of Global Errors'

Open mjuenema opened this issue 2 years ago • 6 comments

ISSUE TYPE
  • Template Issue with error and raw data
TEMPLATE USING
Value Filldown interface (.+) 
Value errorcode (.+)
Value timestamp (.+)
Value description (.+)
Value recommendation (.+)

Start
  ^Interface:\s+${interface} -> Clear
  ^Error Code:\s+${errorcode}
  ^Timestamp:\s+${timestamp}
  ^Description:\s+${description}
  ^Recommendation:\s+${recommendation} -> Record
  ^Global\s+Errors
  ^\s*$$
  ^. -> Error

EOF
SAMPLE COMMAND OUTPUT
 Global Errors :
SUMMARY

The template fails to parse the space before Global Errors

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
textfsm.parser.TextFSMError: State Error raised. Rule Line: 15. Input Line:  Global Errors:

The solution is to change line 13 of the template to below. I am going to submit a Pull Request later.

 ^\s*Global\s+Errors

mjuenema avatar Jan 29 '23 20:01 mjuenema