Pipe/Match - Alcatel-Lucent 7710 SR Configuration Manual

Service router os basic system
Hide thumbs Also See for 7710 SR:
Table of Contents

Advertisement

Entering CLI Commands

Pipe/Match

The 7710 SR OS supports the pipe feature to search one or more files for a given character string
or pattern.
Note: When using the pipe/match command the variables and attributes must be spelled correctly.
The attributes following the command and must come before the expression/pattern. The
following displays examples of the pipe/match command to complete different tasks:
Command syntax:
match [ignore-case] [invert-match] [post-lines num-lines] [max-count
num-matches] [expression] pattern
where:
For example:
A:Dut-C# show log log-id 98 | match ignore-case "sdp bind"
"Status of SDP Bind 101:1002 in service 1001 (customer 1) changed to admin=up oper=up
flags="
"Processing of a SDP state change event is finished and the status of all affected SDP
Bindings on SDP 101 has been updated."
A:Dut-C# show log log-id 98 | match max-count 1 "service 1001"
"Status of service 1001 (customer 1) changed to administrative state: up, operational
state: up"
A:Dut-C# admin display-config | match post-lines 5 max-count 2 expression "OSPF.*Config"
echo "OSPFv2 Configuration"
#--------------------------------------------------
Page 36
Task: Capture all the lines that include "echo" and redirect the output to a file on the
compact flash:
admin display-config | match "echo" > cf3:\echo_list.txt
Task: Display all the lines that do not include "echo":
admin display-config | match invert-match "echo"
Task: Display the first match of "vpls" in the configuration file:
admin display-config | match max-count 1 "vpls"
ignore-case
keyword
invert-match
keyword
num-lines
1 — 2147483647
num-matches
1 — 2147483647
expression
keyword
pattern
string or regular expression
ospf
7710 SR OS Basic System Configuration Guide

Advertisement

Table of Contents
loading

Table of Contents