cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
31890
Views
50
Helpful
7
Replies

multiple pipe search

Hi All,

I want to search for a wwn in show fcns database detail command
switch# show fcns database | include fc:58
0x830045    N     xx:xx:xx:xx:xx:xx:fc:58 (HP) 

However this command does not give me the rest of the important details which would be normally mentioned as listed below.

VSAN:1     FCID:0x690000
------------------------
port-wwn (vendor)           :10:00:00:0d:ec:af:fe:05 (Cisco)
node-wwn                    :20:00:00:0d:ec:af:fe:00
class                       :2,3
node-ip-addr                :0.0.0.0
ipa                         :ff ff ff ff ff ff ff ff
fc4-types:fc4_features      :ipfc
symbolic-port-name          :
symbolic-node-name          :
port-type                   :N
port-ip-addr                :192.180.1.5
fabric-port-wwn             :22:00:00:0d:ec:af:fe:02
hard-addr                   :0x000000
permanent-port-wwn (vendor) :00:00:00:00:00:00:00:00
connected interface         :Not Available
switch name (IP address)    :switch (ip addr)

 

Is there a way to search multiple things which will still allow me to include the important details like switch ip and name etc.

Any help is much appreciated

 

1 Accepted Solution

Accepted Solutions

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

Many Cisco devices support regular expressions.  An or match might be something like:

show something | inc abc|xyx

View solution in original post

7 Replies 7

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

Many Cisco devices support regular expressions.  An or match might be something like:

show something | inc abc|xyx

This discussion has been reposted from Top Contributors to the Storage Networking community.

Thanks Joseph

hfarias
Level 1
Level 1

Example For IOS-XR 

 

show bgp vrf ALL neighbors | in "vrf | hold time: | Hold time is"

 

regards

 

Besides using the pipe '|' as an OR function, I often use the 'p' for previous lines and 'n' for next lines.

 

HQSAN14# show fcns database detail | inc i 50:00:09:73:a8:06:c4:dd p 3 n 11
------------------------
VSAN:20 FCID:0x100141
------------------------
port-wwn (vendor) :50:00:09:73:a8:06:c4:dd (EMC)
                   [SYM0933-APPLICATION-4DP29]
node-wwn :50:00:09:73:a8:06:c7:ff
class :3
node-ip-addr :0.0.0.0
ipa :ff ff ff ff ff ff ff ff
fc4-types:fc4_features :scsi-fcp:both 253
symbolic-port-name :SYMMETRIX::000197800933::SAF-4d1d::FC::5977_952+::EMUL B90F0000 59DD3921 CA7F8C 12.20.16 09:16
symbolic-node-name :SYMMETRIX::000197800933::FC::5977_952+
port-type :N
port-ip-addr :0.0.0.0
fabric-port-wwn :22:4d:00:de:fb:18:b5:80
hard-addr :0x000000
permanent-port-wwn (vendor) :50:00:09:73:a8:06:c4:dd (EMC)
connected interface :fc10/13
switch name (IP address) :HQSAN14 (192.168.102.160)
------------------------
VSAN:20 FCID:0x100160

Ancient post, but I'll pile on with a new comment too.

 

In Nexus you can use grep and return the lines before or after the match:

 

This returns the fcns database entry line for Server 1 and the following 2 lines (notice the -A)

#sh fcns database | grep -A 2 "Server1"

 

This returns the fcns database entry line for Server 1 and the 2 lines before the match (notice the -B)

#sh fcns database | grep -B 2 "Server1"

 

I particularity like this when I'm looking at the flogi database, because there are 2 lines for every entry (at least on the N5K platform).

#sh flogi database | grep -A 1 "Server1"

 

Kinda the same as mooneyj's post above.

 

I wish that IOS-XE would've stolen this. It's a very useful feature. Cough cough....

Just tested the following and it worked.

show chassis detail | egrep "Model|Power| Serial"

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: