s = """switch_168#sh cdp neighbors detail
-------------------------
Device ID: SW-PRITHVI-SRG-MM26
Entry address(es):
IP address: 10.104.105.115
Platform: cisco WS-C2960-48PST-L, Capabilities: Switch IGMP
Interface: GigabitEthernet1/0/15, Port ID (outgoing port): FastEthernet0/32
Holdtime : 126 sec
Version :
Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(50)SE4, RELEASE SOFTWARE (fc1)
Technical Support: http://w...content-available-to-author-only...o.com/techsupport
Copyright (c) 1986-2010 by Cisco Systems, Inc.
Compiled Fri 26-Mar-10 09:14 by prod_rel_team
advertisement version: 2
Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=00000000FFFFFFFF010221FF00000000000040F4EC800F80FF0000
VTP Management Domain: 'RDP'
Native VLAN: 804
Duplex: full
Management address(es):
IP address: 10.104.105.115
-------------------------
Device ID: SW-PRITHVI-SRG-MM28
Entry address(es):
Platform: cisco WS-C3560G-48PS, Capabilities: Switch IGMP
Interface: GigabitEthernet1/0/35, Port ID (outgoing port): GigabitEthernet0/31
Holdtime : 124 sec
Version :
Cisco IOS Software, C3560 Software (C3560-IPBASE-M), Version 12.2(50)SE5, RELEASE SOFTWARE (fc1)
Technical Support: http://w...content-available-to-author-only...o.com/techsupport
Copyright (c) 1986-2010 by Cisco Systems, Inc.
Compiled Tue 28-Sep-10 13:21 by prod_rel_team
advertisement version: 2
Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=00000000FFFFFFFF010221FF00000000000058BFEA234E00FF0000
VTP Management Domain: ''
Native VLAN: 1
Duplex: full
-------------------------
Device ID: SEP08D09F9FC91F
Entry address(es):
IP address: 192.168.1.3
Platform: Cisco IP Phone 9971, Capabilities: Host Phone Two-port Mac Relay
Interface: GigabitEthernet1/0/41, Port ID (outgoing port): Port 1
Holdtime : 168 sec
Second Port Status: Down
Version :
sip9971.9-4-2SR2-2
advertisement version: 2
Duplex: full
Power drawn: 14.389 Watts
Power request id: 8144, Power management id: 10
Power request levels are:14389 0 0 0 0
Spare Pair PoE: Yes, Spare Pair Detection Required: No
Spare Pair PD Config: Enable, Spare Pair PSE Operational: No
Total cdp entries displayed : 3"""
r = s.split("Device ID")
x = r[1]
z = x.split("IP address:",1)
print z