Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle minor variations (is it possible to do "if")? #237

Open
joubbi opened this issue May 13, 2019 · 0 comments
Open

How to handle minor variations (is it possible to do "if")? #237

joubbi opened this issue May 13, 2019 · 0 comments
Assignees

Comments

@joubbi
Copy link

joubbi commented May 13, 2019

  • Documentation Report

I am creating templates for some Cisco IOS devices.
Unfortunately Cisco is not consistent with the output on some of their commands across IOS versions and devices.

For example the command "show vtp status" outputs:

VTP version running             : 2

on some switches. And this on others:

VTP Version                     : 2

Is it possible to handle this with an if statement or or?
(regexp like this, if null then regexp like this instead).
Or something similar to this:

pattern_match:
    regex: "VTP Version capable             : (.*)" | "VTP Version                     : (.*)"

Also the amounts of whitespace between names and variables differ on different devices:

Number of existing VLANs          : 34
Number of existing VLANs        : 8

I haven't found any examples or documentation on how to handle these situations.

EDIT:
I solved this particular problem with this regex:

regex: "VTP \\Sersion [r|\\s][u|\\s][n|\\s][n|\\s][i|\\s][n|\\s][g|\\s]             : (.*)"

Still I would like to know if there is a possibility to do an if statement.
Also more documentation would be very helpful.

@trishnaguha trishnaguha self-assigned this May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants