KBI 311528 Free Argent Scan Log CLI

Version

Argent Advanced Technology — All Versions

Date

Thursday, 23 February 2017

Summary

Understanding the customer’s pain of scanning any Windows log file to debug an issue, Argent has released Argent Scan Log command line utility. This easy-to-use utility can scan multiple windows log files for a specified string pattern and return number of lines found. In seconds customers can pin point the issue easily with the help of start and end timestamps of logs. Argent Scan Log also support regular expressions and match case.

Example:

ARGENT_SCANLOG_CLI.exe -help shows the usage of Argent Scan Log CLI

Technical Background

Argent provides a CLI to scan log files

Usage:

ARGENT_SCANLOG_CLI.EXE [-ts] [-start] [-end] -log -match

-ts
Timestamp Format. This should be specified in the same format as the timestamp in the log file.

-start
Specifies the start time. Logs written on or after this time value will be considered in the result.

-end
Specifies the end time. Logs written before this time value will be considered in the result.

-log
File name. Wildcard support is added

-match
Pattern to be matched. All the lines that match this string pattern will be considered in the result.

-regex
Indicates that the specified pattern is a regular expression. It is a special text string for describing a search pattern.

Examples:

  • \[(.*?)\] – Pattern to search for all substrings that are enclosed in []
  • START-(.*?)-END – Pattern to get all strings between START- and -END
  • ERROR=\s*([^\n\r]*) – Pattern to get all strings that starts with ERROR=

-literal
Indicates that the specified pattern is a literal string which can be exactly matched with the log text.

-case
Specifies if the search has to be case sensitive. If this option is specified, the search is case sensitive.

Examples:

  • ARGENT_SCANLOG_CLI.EXE -ts “dd MMM yyyy HH:mm:ss.mms” -start “2013-09-01 13:00:00” -log C:\Argent\ArgentGuardianUltra\LOGS\*SVC_LOG.TXT -match “ERROR”

    This example scans the specified log files for the occurrence of string “ERROR” after time “2013-09-01 13:00:00” and returns all the lines found with the specified pattern in the log file.

  • ARGENT_SCANLOG_CLI.EXE -ts “dd MMM yyyy HH:mm:ss.mms” -start “2013-09-01 13:00:00” -end “2017-01-01 19:30:00” -log C:\Argent\ArgentGuardianUltra\LOGS\*SVC_LOG.TXT -match “ERROR”

    This example scans the specified log files for the occurrence of string “ERROR” between time “2013-09-01 13:00:00” and “2017-01-01 19:30:00” and returns all the lines found with the specified pattern in the log file.

  • ARGENT_SCANLOG_CLI.EXE -log C:\Argent\ArgentGuardianUltra\LOGS\*SVC_LOG.TXT -match “Error|Could not|Failed” -regex

    This example scans the specified log files for the occurrence of strings “Error” or “Could not” or “Failed” using regular expression and returns all the lines found with the specified pattern in the log file.

  • ARGENT_SCANLOG_CLI.EXE -log C:\Argent\ArgentGuardianUltra\LOGS\*SVC_LOG.TXT -match “ERROR\s*([^\n\r]*)” -regex

    The example scans the specified log files for the occurrence of strings that starts with “ERROR” using regular expression and returns all the lines found with the specified pattern in the log file.

  • ARGENT_SCANLOG_CLI.EXE -log C:\Argent\ArgentGuardianUltra\LOGS\*SVC_LOG.TXT -match “**** ERROR ****” -literal

    The example scans the specified log files for the occurrence of literal string “**** ERROR ****” which can be exactly matched with the log text and returns all the lines found with the specified string in the log files

  • ARGENT_SCANLOG_CLI.EXE -log C:\Argent\ArgentGuardianUltra\LOGS\*SVC_LOG.TXT -match “**** WARNING ****” -literal -case

    The example scans the specified log files for the occurrence of literal string “**** WARNING ****” which can be exactly matched with the log text and returns all the lines found with the specified pattern in the log file. Here is ‘-case’ option is specified, so the search is case sensitive.

Resolution

N/A