Flow filtering features using standard UNIX commands


Article ID: 168039


Updated On:




CBS CLI filtering features for flowIt may be easier to string search the flow table by invoking native UNIX commands.


The following are some examples of using Linux shell filtering features to filter the output of cli commands. These examples are run from the linux prompt on the CPM.

Display flows being reported as drops in the AFT ( including 2 lines after filtered data):

/crossbeam/bin/cli -i 'show flow act' |grep -i -A2 drop

Same command but exporting to a file:

/crossbeam/bin/cli -i 'show flow act' |grep -i -A2 drop > flowdrop.txt

Showing traplog messages for a certian date (Including 3 lines after and 4 lines before filterd data) :

/crossbeam/bin/cli -i 'show traplog' |grep -i -A3 -B4 2009-11-25

Same command but exporting to a file:

/crossbeam/bin/cli -i 'show traplog' |grep -i -A3 -B4 2009-11-25 > nov11trap.txt

Searching for an IP address in your show run:

/crossbeam/bin/cli -i 'show running-config" |grep -i

Search Audit trail for last time the reload command was run:

/crossbeam/bin/cli -i 'show audit-trail' |grep -i reload

The watch command can also be used to monitor the output of commands, watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time:

watch --i=2 "/crossbeam/bin/cli -i \"show ap-vap-mapping\""

watch --i=2 "/crossbeam/bin/cli -i \"show interface gig 1/1\""

watch --i=2 "/crossbeam/bin/cli -i \"show heartbeat np1\""