Relog command in Windows

(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012)

(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016 , Windows Server 2012 R2, Windows Server 2012 )

The relog command helps extract performance counters fromperformancecounter logs to other formats, such as text-TSV (for tab-delimited text), text -CSV (for comma-separated text), binary-BIN or SQL.

Syntax of relog command

 relog [[.]] [/ a] [/ c [.]] [/ cf] [/ f {bin | csv | tsv | SQL}] [/ t] [/ o {OutputFile | DSN! CounterLog}] [/ b [[:]:]] [/ e [[:]:]] [/ config {| i}] [/ q] 

The relog command parameter

Parameters

Describe

FileName [ FileName .]

Specify the path name of anexistingperformancecounter logfile.You can specify multiple files as input values.

-a

Specifiesappending data to the output file instead of overwriting.This option does not apply to SQL format.

-cpath [ path .]

Specify the path to access the performance counter file.To specify multiple counter paths, separate them with spaces and place access paths in quotation marks (for example, "Counterpath1 Counterpath2").

-cfFileName

Specify the path of the text file that lists the performance counters included in the relog file.You use this option to list the counter paths in the input file, each path is a line.The default setting is that all counter in the original log file are relog.

csv | tsv | SQL}

Specify the path name of the output file format.The default format is bin.For an SQL database, the output file will specify the DSN!CounterLog.You can specify the database location by using the ODBC manager to configure the DSN (Database System Name).

-tValue

Specify sample segment divisions in "N" records, including all nth data points in the relog file.

-o {OutputFile | "SQL: DSN! Counter_Log} where DSN is an ODMC DSN defined on the system.

Specify the path name of the output file or SQL database where the counter will be recorded.

Note: For 64-bit and 32-bit versions of Relog.exe, you will need to specify the DSN in ODBCData Source(64-bit and 32-bit respectively).

-b <M / D / YYYY > [[ HH :] MM :] SS

Specify the start time to copy the first record from the input file.The date and time must be in the correct format: month / day / year, hour: minute: seconds.

-e <M / D / YYYY > [[ HH :] MM :] SS

Specifies the end time to copy the last record from the input file.The date and time must also be in the correct format: month / day / year, hour: minute: seconds.

-config {FileName | i}

Specify the path name of the installation file containing the command line parameter.Use the -i parameter in the configuration file asa placeholderfor the list of input files that can be placed on the command line.

-q

However, on each command line, you do not need to use i.You can also use wildcards like * .blg to specify multiple input file names.

-y

Assign to ignore the notifications, by answering "yes" to all questions while the command is executed.

/?

Show help at thecommand prompt.

An explanation of the relog command

For counter path format:

  1. The general format for the counter path will be as follows: [] [ ] ] in which Parent, Instance, Index, and Counter components of the format can contain valid names or wildcards. Computer, Parent, Object and Index components are optional parameters, not necessarily on all counters.
  2. You define the counter paths to use based on the counter itself. For example, LogicalDisk object has an instance, so you must provide either #index or a wildcard. That's why you can use the following format: LogicalDisk (* / * # *) *
  3. Meanwhile, the Process object does not require one . Therefore, you can use the following format: Process (*) ID Process
  4. If a wildcard is specified in the Parent parameter, all instances of the specified object match the specified instances and the counter fields will be returned.
  5. If the wildcard is specified in the Instance parameter, all instances of the specified object and the parent object will be returned if all instance names corresponding to the index are specified. match the wildcard.
  6. If the wildcard is specified in the counter name, all counters of the specified object will be returned.
  7. The string matching of an access path part (eg pro *) will not be supported.
  8. For counter files:

    1. Counter files are text files that list one or more performance counters in an existing log. Copy the full counter name from the log or the / q output in the format .

Copy counters:

  1. When executed, the relog command will copy the specified counters from all records in the input file, and convert the format if needed.The allowed wildcard paths appear in the counter file.

Save the subset of input results:

  1. Use the / t parameter to specify that the input files will be inserted into the output files in each record.By default, data will be relogged from each record.

Use parameter / b and / e with log files:

  1. You can specify that your output records will attach records from before start time (ie / b) to provide data for counters that require calculated values ​​of values. is formatted.The output file will have the last record from the input files with the timestamp smaller than the / e parameter (ie end).

Use the / config option:

  1. The contents of the installation file used with the / config option must have the following format:, Insideis a command line option andis the parameter that determines its value.

For more information about integrating relogs into your Windows Management Instrumentation (WMI) scripts, refer to the "Scripting WMI" section on the Microsoft Windows Resource Kits website .

Example of relog command

To reset the currentlog logtemplate (existing trace log)at a fixed time interval of 30, list access paths, files and output formats, enter:

 relog c: perflogsdaily_trace_log.blg / cf counter_file.txt /oc:perflogsreduced_log.csv / t 30 / f csv 

To reset theexisting trace logtemplate toa fixed time of 30, list the access paths and output files, enter:

 relog c: perflogsdaily_trace_log.blg / cf counter_file.txt /oc:perflogsreduced_log.blg / t 30 

To return anexisting trace logto a database, type:

 relog "c: perflogsdaily_trace_log.blg" -f sql -o "SQL: sql2016x64odbc! counter_log" 

See more:

  1. The qprocess command in Windows
  2. Qappsrv (query termserver) command in Windows
  3. The quser (query user) command in Windows
  4. The pubprn command and the pushprinterconnections command in Windows
3.9 ★ | 49 Vote