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

?

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