Log Correlation Command Line Utility (consolidate-logs.bat)

Command line utility to consolidate, correlate, and filter the content of the server logs. The utility is limited to the SAP Mobile Server and cluster logs. The consolidate-logs.bat utility is typically used by the SAP Mobile Platform support team, but can be used by administrators to collect data for analysis or reporting to the support team.

Syntax

consolidate-logs.bat [options]
Where  [options] can be
   [-h|-help]
   [-v |-verbose]
   [-w|-windows app|smp|sys|none app-name]
   [-a|-application app-name]
   [-c|-connection con-name]
   [-d|-domain domain-name]
   [-u|-user user-name]
   [-f|-from  yyyy-mm-ddTthh:mm:ss ]
   [-t|-to  yyyy-mm-ddTthh:mm:ss]
   [-q|-query  jms-selector]
   [-m|-match  "count op N"]
   [-e|-error  jms-selector]
   [-e|-error  tool-warnings]
   [-n|-network  shared-path]
   [-x:rs| rs-host-logs-dir]
   [-x:sa| sa-host-logs-dir]
   [-i|-input input-file]
   [-o|-output output-file]
   [-r|-rows maximum-rows]
   [-s|-size maximum-size]
  

Parameters

consolidate-logs.bat options:
Option Description
-w | -windows app | smp | sys | none

Specifies which types of events to include. For example, -w smp excludes system events and non-SMP application events. The default is all system and application events.

-a | -application app-name

Excludes all app-id specific entries not for the specified application id. If the option is omitted, all app-id specific data is included (unless another filter is applied).

-c | -connection con-name

Excludes all application connection id specific entries not for the specified application connection id. If the option is omitted, all application connection id specific data is included (unless another filter is applied).

-d | -domain domain-name

Excludes all domain specific entries not for the specified domain. If the option is omitted, domain specific data is included (unless another filter is applied).

-u | -user user-name

Excludes all user specific entries not for the specified user. If the option is omitted, all user specific data is included (unless another filter is applied).

-f | -from yyyy-mm-ddTthh:mm:ss

Specifies the start date in the format yyyy-mm-ddTthh:mm:ss . The hour follows the 24-hour format. The trailing section of the date/time parameter can be omitted, but the leading sections cannot be.  For example:

yyyy-mm-ddTthh:mm:ss, for example, 2000-03-22T12:34:56
yyyy-mm-ddTthh:mm, for example, 2000-03-22T12:34
yyyy-mm-ddTthh, for example, 2000-03-22T12
yyyy-mm-dd, for example, 2000-03-22
yyyy-mm, for example, 2000-03
yyyy, for example, 2000

If this option is not specified, the tool correlates the logs from the oldest log entry available.

-t | -to yyyy-mm-ddTthh:mm:ss

Specifies the end date in the format yyyy-mm-ddTthh:mm:ss . The hour follows the 24-hour format. The trailing section of the date/time parameter can be omitted, but the leading sections cannot be.  For example:

yyyy-mm-ddTthh:mm:ss, for example, 2000-03-22T12:34:56
yyyy-mm-ddTthh:mm, for example, 2000-03-22T12:34
yyyy-mm-ddTthh, for example, 2000-03-22T12
yyyy-mm-dd, for example, 2000-03-22
yyyy-mm, for example, 2000-03
yyyy, for example, 2000

If this option is not specified the tool correlated the logs up to the latest log entry available.

-q | -query jms-selector

Specifies a JMS message selector to include only those entries that match the query.

-m | -match "count op N"

Advanced option that you can programmatically invoke. If the condition is not met, returns 1. Otherwise, returns 0.

-e | -error jms-selector

Advanced option that you can programmatically invoke. If the condition is not met, returns 1. Otherwise, returns 0.

-e | -error tool-warnings

Advanced option that you can programmatically invoke. If there are any warnings, returns 1. Otherwise, returns 0.

-n | -network shared-path

Specifies a path name for all nodes of the cluster.

-x:rs rs-host-logs-dir

Specifies a directory path for Relay Server log files.

-x:sa sa-host-logs-dir

Specifies a directory path for SQL Anywhere log files.

-i | -input input-file

Name of the an input file generated by this tool. For example, -i old-consolidated.log.

-o | -output output-file

Name of the consolidated and correlated server log content file. If the option is omitted, the tool prints the correlated log content stream to the console/stdout (warnings about missing content sources are printed to stderr). The header file is called <output>-info.txt.

-r | -rows maximum-rows

The maximum number of rows for each individual output file (default is 1000). If the number of rows are exceeded, the content is split into multiple files with a suffix number in the file name. If –o is not included, this option is ignored. This option is recommended if using a spreadsheet program to view log files.

-s | -size maximum-size

The maximum file size in KB for each individual output file (default is 1000). If the size is exceeded, the content is split into multiple files with a suffix number in the file name. If –o is not included, this option is ignored. This option is recommended if using a text editor to view log files.

Note: Since the Windows shell has special treatment for the percent character, you need to double or escape each ‘%’ in the JMS selector based “-query” option. For example, to find all the log entries containing the word “system”, use the following syntax:
-query “message like ‘%%system%%’” 

Examples