Some "| include" in one command

Answered Question
Mar 19th, 2009
User Badges:

Hello, I am managing a Cisco 2801 router and I want to view some information from a command. For example:


###start code###


router#show ip sla monitor statistics

Round trip time (RTT) Index 1

Latest RTT: 44 ms

Latest operation start time: 12:41:18.244 MET Thu Mar 19 2009

Latest operation return code: OK

RTT Values

Number Of RTT: 500

RTT Min/Avg/Max: 43/44/48 ms

Latency one-way time milliseconds

Number of one-way Samples: 500

Source to Destination one way Min/Avg/Max: 21/22/26 ms

Destination to Source one way Min/Avg/Max: 21/21/22 ms

Jitter time milliseconds

Number of SD Jitter Samples: 499

Number of DS Jitter Samples: 499

Source to Destination Jitter Min/Avg/Max: 0/1/3 ms

Destination to Source Jitter Min/Avg/Max: 0/1/1 ms

Packet Loss Values

Loss Source to Destination: 0 Loss Destination to Source: 0

Out Of Sequence: 0 Tail Drop: 0 Packet Late Arrival: 0

Voice Score Values

Calculated Planning Impairment Factor (ICPIF): 0

Mean Opinion Score (MOS): 0

Number of successes: 12

Number of failures: 0

Operation time to live: Forever


###finish code###


I just want to view theese four lines:


Latency one-way time milliseconds

Number of one-way Samples: 500

Source to Destination one way Min/Avg/Max: 21/22/26 ms

Destination to Source one way Min/Avg/Max: 21/21/22 ms


With "| include something" I can select just one line, but I want to view the four lines.


Is any way to do that?


Thanks for all, regards.


Josu Lazkano.

Correct Answer by Martin Ermel about 8 years 1 week ago

I would say the following should work for you:

sh ip sla monitor statistics | include way


And to do the same with multiple string search:

sh ip sla monitor statistics | include Latency|of one-way|Destination one|Source one


NOTE: no spaces between the '|' and the different search strings

(i tested this with IOS Version 12.2(18)SXF8)


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Martin Ermel Thu, 03/19/2009 - 05:41
User Badges:
  • Blue, 1500 points or more

I would say the following should work for you:

sh ip sla monitor statistics | include way


And to do the same with multiple string search:

sh ip sla monitor statistics | include Latency|of one-way|Destination one|Source one


NOTE: no spaces between the '|' and the different search strings

(i tested this with IOS Version 12.2(18)SXF8)


jlazkanocgp Thu, 03/19/2009 - 06:21
User Badges:

Thank you very much!


This is exactly what I was looking for.


Thanks again.

Actions

This Discussion