Knowledge Base/Tips, Tricks & FAQ's

FAQ: Is there a command that can be used for searching on a large number of log files?

Rick Tuhimata - DataLock Support
posted this on July 15, 2009 11:26 am

  1. Product Version:
    OS: All platforms

  2. Description:
    Is there a command that can be used for searching on a large number of log files (e.g. backup client logs, [DataLock Software] logs)?

  3. Steps:
    Please refer to the following example for more details.

    Open a command prompt:

    a.  Navigate to the directory where the log files reside, in this case:

    Example of [DataLock Software] backup log:
    >cd C:\Documents and Settings\Administrator\.obm\log\Backup_ID\Backup

    b.  Enter the following command to combine all log files into a single output file called "output.log":

          Example:
          >type*.* > output.log

    c.  Enter the following command to search for a specific "text" within the output file.

         Example:
        >type output.log | find "text"


    Notes:
    You can actually replace "text" with any text that you want to search within the output file. The entries which contain the searched text, in this case "text" will be displayed in the command prompt.



  4. Also See:
    For command on Linux or Mac OS X, please refer to the following:

    Example:
    >cat * | grep 'text'


  5. Other Info:
    N/A