Cisco Cisco Email Security Appliance C190 Technical References

Page of 314
 
223
Cisco AsyncOS 9.1 for Email 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:
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' ()
Fri Jun  9 22:47:41 2006 Info: sophos antivirus - MID 5 - Result 'CLEAN' ()
Fri Jun  9 22:47:41 2006 Info: sophos antivirus - MID 6 - Result 'CLEAN' ()
Fri Jun  9 22:47:42 2006 Info: sophos antivirus - MID 12 - Result 'CLEAN' ()
Fri Jun  9 22:53:04 2006 Info: sophos antivirus - MID 18 - Result 'VIRAL' ()
Fri Jun  9 22:53:05 2006 Info: sophos antivirus - MID 16 - Result 'VIRAL' ()
Fri Jun  9 22:53:06 2006 Info: sophos antivirus - MID 19 - Result 'VIRAL' ()
Fri Jun  9 22:53:07 2006 Info: sophos antivirus - MID 21 - Result 'VIRAL' ()
Fri Jun  9 22:53:08 2006 Info: sophos antivirus - MID 20 - Result 'VIRAL' ()
Fri Jun  9 22:53:08 2006 Info: sophos antivirus - MID 22 - Result 'VIRAL' ()
mail3.example.com>
grep [-C count] [-e regex] [-i] [-p] [-t] [regex] log_name
Table 3-13
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.