Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Cisco to Juniper - parser help

by LanX (Saint)
on May 24, 2021 at 13:57 UTC ( [id://11132965]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Cisco to Juniper - parser help
in thread Cisco to Juniper - parser help

> the MTU is a part of the above line,

does it mean

  • it's a continuation of the previous line indicated by the extra indentation
  • it's nested information, and this cisco format has to be parsed like a tree
?

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^4: Cisco to Juniper - parser help
by jamescmatt (Novice) on May 24, 2021 at 14:09 UTC
    service instance 20 ethernet description Internal site encapsulation dot1q 17 rewrite ingress tag pop 1 symmetric xconnect 192.168.51.20 838969735 encapsulation mpls mtu 9202 !
    The above is exactly the configuration for each service instance. The extra indentation for the MTU is because the MTU is being applied to the configuration of the xconnect (xconnect being nested under service instance, mtu nested under xconnect). Hope that helps. edit: forgot a /
Re^4: Cisco to Juniper - parser help
by jamescmatt (Novice) on May 24, 2021 at 14:45 UTC
    Yes, the xconnect is nested under the service instance(directly configured under the service instance), and the MTU is nested under the xconnect(directly configured under the xconnect).
      I don't think I know enough about those tools to help you, and you don't understand my questions.

      Your code is also very hard to read for me.

      A general solution is to parse your tree data into a nested array of hashes and to traverse that to output your new format.

      But I don't know if that's really necessary because I don't understand the data.

      I hope someone with deeper knowledge of your domain will pass by and can help you. :)

      update

      see also

      Re: Cisco to Juniper - parser help

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11132965]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-16 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found