Troubleshooting Tools
Accessing the Syslog
6-20
CLI Maintenance Guide
Searching Through the Syslog
Use the
grep
command to apply a regular expression to the syslog as you page
through it, viewing only the lines that contain a desired string:
grep
pattern
logs [
filename
]
where
pattern
(1-255 characters) is the regular-expression pattern to search for in
the syslog. The grep displays all lines containing this pattern.
The regular expression syntax follows grep’s “basic” regular-expression
syntax:
•
.
matches any single character.
•
.*
matches any string, including the null string.
•
[...]
matches any one of the enclosed characters.
•
[a-z]
matches any character in the sorted range, a through z.
•
\
matches the next character, even if it has special meaning (for example,
\.
matches a period instead of any character).
•
[^...]
matches any character that is
not
enclosed. For example, [^0-9]
matches any single character that is not a number from 0 to 9.
logs
is a required keyword; this specifies the “logs” directory, where the
syslogs are stored.
filename
(optional, 1-255 characters) identifies one file to search. If you
omit the filename, the CLI searches through all files in the logs directory.
Use the
show logs
command to see a list of accessible log files.
For example, the following command searches the active syslog for the string,
“LOGMGRD:”
bstnA6k(cfg)#
grep LOGMGRD logs syslog
sm-3-2:2004-05-06T06:24:53.362-0400:3-apm-277:LOGMGRD-0-6(I)-MSG6:Version
0.12.0.4649 (May 05 2004 02:19:30) [nbuilds] (build 4649) shutting down
sm-3-1:2004-05-06T06:24:53.460-0400:3-apm-277:LOGMGRD-0-6(I)-MSG6:Version
0.12.0.4649 (May 05 2004 02:19:30) [nbuilds] (build 4649) shutting down
2004-05-06T06:28:57.177-0400:SWITCH:1-1-SCM-437:LOGMGRD-0-6-MSG6:: Version
0.12.0.4650 (May 05 2004 18:04:50) [lwisniewski] (build 4650) starting up
Summary of Contents for Adaptive Resource Switch
Page 12: ...2 xii CLI Maintenance Guide...
Page 62: ...Backing Up the Running Configuration Restoring the Configuration 3 24 CLI Maintenance Guide...
Page 128: ...Metadata Utilities nsck and sync Clearing All nsck Jobs 5 48 CLI Maintenance Guide...
Page 206: ...Troubleshooting Network Connections Configuring Port Mirroring 7 32 CLI Maintenance Guide...
Page 306: ...GUI Maintenance Restarting the GUI 10 4 CLI Maintenance Guide...
Page 316: ...Powering Down the ARX Restoring Power 11 10 CLI Maintenance Guide...
Page 318: ...Copyright 2 CLI Maintenance Guide...
Page 324: ...Index 6 CLI Maintenance Guide...