VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Need a help (https://forums.vandyke.com/showthread.php?t=14394)

saanajjar 01-15-2021 02:13 AM

Need a help
 
Hi

i wanna to do below function so i wanna help as im new to this .

10926752_MOH#sh arp | in GigabitEthernet0/0/1.700
Internet 10.111.191.129 - 10b3.c67f.7f11 ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.130 9 7cc3.8537.9b5b ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.131 15 1802.2d30.c3c0 ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.132 14 1802.2d30.c5a0 ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.133 15 1802.2d30.c700 ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.134 15 1802.2d30.c460 ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.135 12 1802.2d30.dea0 ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.136 14 1802.2d30.c520 ARPA GigabitEthernet0/0/1.700
Internet 10.111.191.137 15 1802.2d30.c2c0 ARPA GigabitEthernet0/0/1.700

I need to copy from above output the IP to Variable A and MAC address to Variable B

Example

A= 10.111.191.137
B= 1802.2d30.c2c0


i need a script to do this

bgagnon 01-15-2021 10:12 AM

Hi saanajjar,

We don't write custom scripts but there are many examples of parsing data sprinkled throughout the forums.

What version of SecureCRT? On what platform?

First, I would suggest you read Chapter 4 of the Scripting Manual.

Even if you choose to write your script in another scripting language, this will provide you the necessary concepts of capturing data. You likely are going to need to use a regular expression to parse the specific data. That information is found near the end of chapter 4.

Here is a forum thread that has regex info about capturing MAC addresses. The first post is where the script code was provided, but you'll need to read the responses as jdev had to help mybox65 work out some problems in their script.


All times are GMT -6. The time now is 05:13 PM.