Cisco Cisco Email Security Appliance C160 Références techniques

Page de 458
 
367
Cisco AsyncOS 8.5 CLI Reference Guide
 
Chapter 3      The Commands: Reference Examples
  Logging and Alerts
Usage
Commit: This command does not require a ‘commit’.
Cluster Management: This command is restricted to machine mode. It is further restricted to the login 
host (i.e., the specific machine you are logged onto). This command requires access to the local file 
system.
Batch Command: This command does not support a batch format.
The 
grep
 command can be used to search for text strings within logs. Use the following syntax when 
you run the 
grep
 command:
Note
You must enter either 
-e regex
 or 
regex 
to return results. 
Use the following options when you run the 
grep
 command:
Example of grep
The following example shows a search for the text string ‘clean’ or ‘viral’ within the antivirus logs. The 
grep command includes a regex expression:
grep [-C count] [-e regex] [-i] [-p] [-t] [regex] log_name
Table 3-150
grep
 Command Options
Option
Description
-C
Provides lines of context around the grep 
pattern found. Enter a value to specify the 
number of lines to include.
-e 
Enter a regular expression.
-i
Ignores case sensitivities.
-p
Paginates the output.
-t
Runs the grep command over the tail of the log 
file.
regex
Enter a regular expression.
Table 3-151
grep-Search for Text in a Log File
mail3.example.com> grep "CLEAN\\|VIRAL" antivirus
Fri Jun  9 21:50:25 2006 Info: sophos antivirus - MID 1 - Result 'CLEAN' ()
Fri Jun  9 21:53:15 2006 Info: sophos antivirus - MID 2 - Result 'CLEAN' ()
Fri Jun  9 22:47:41 2006 Info: sophos antivirus - MID 3 - Result 'CLEAN' ()
Fri Jun  9 22:47:41 2006 Info: sophos antivirus - MID 4 - Result 'CLEAN' ()