TSV (タブ区切りのテキスト)、CSV (コンマ区切りのテキスト)、バイナリ、または SQL など、他の形式にパフォーマンス カウンターのログからパフォーマンス カウンターを抽出します。
Note
For more information about incorporating relog into your Windows Management Instrumentation (WMI) scripts, see the Scripting blog.
Syntax
relog [<filename> [<filename> ...]] [/a] [/c <path> [<path> ...]] [/cf <filename>] [/f {bin|csv|tsv|SQL}] [/t <value>] [/o {outputfile|DSN!CounterLog}] [/b <M/D/YYYY> [[<HH>:] <MM>:] <SS>] [/e <M/D/YYYY> [[<HH>:] <MM>:] <SS>] [/config {<filename>|i}] [/q]
Parameters
Parameter | Description |
---|---|
filename [filename ...] |
既存のパフォーマンス カウンター ログのパス名を指定します。 複数の入力ファイルを指定できます。 |
-a | 出力ファイルを上書きする代わりに追加します。 このオプションは、SQL 形式の既定値は常に追加するには適用されません。 |
-c path [path ...] |
ログに記録するパフォーマンス カウンターのパスを指定します。 複数のカウンターのパスを指定するには、スペースで区切ってカウンターのパスを引用符で囲みます (たとえば、"path1 path2" )。 |
-cf filename | Relog ファイルに含まれるパフォーマンス カウンターの一覧をテキスト ファイルのパス名を指定します。 カウンター パスを入力ファイルで、行ごとに 1 つは、このオプションを使用します。 既定値は、元のログ ファイル内のすべてのカウンターをログします。 |
-f {bin | csv | tsv | SQL} |
出力ファイルの形式のパス名を指定します。 The default format is bin. SQL データベースの場合、出力ファイルは DSN!CounterLog を指定します。 DSN (データベースのシステム名) を構成する ODBC マネージャーを使用して、データベースの場所を指定できます。 |
-t value | Specifies sample intervals in n records. Relog ファイルにすべての n 番目のデータ ポイントが含まれています。 既定値は、すべてのデータ ポイントです。 |
-o {Outputfile | SQL:DSN!Counter_Log} |
出力ファイルまたは SQL データベースのカウンターの書き込み先のパス名を指定します。 Note: For the 64-bit and 32-bit versions of relog.exe, you must define a DSN in the ODBC Data Source (64-bit and 32-bit respectively) on the system. DSN を定義するには、"SQL Server" ODBC ドライバーを使用します。 |
-b <M/D/YYYY> [[<HH>:]<MM>:]<SS>] |
入力ファイルから最初のレコードをコピーする開始時刻を指定します。 日付と時刻は、厳密に M/D/YYYYHH:MM:SS 形式でなければなりません。 |
-エ <M/D/YYYY> [[<HH>:]<MM>:]<SS>] |
入力ファイルから最後のレコードをコピーする終了時刻を指定します。 日付と時刻は、厳密に M/D/YYYYHH:MM:SS 形式でなければなりません。 |
-config(設定) {filename | i} |
コマンド ライン パラメーターを含む設定ファイルのパス名を指定します。 If you're using a configuration file, you can use -i as a placeholder for a list of input files that can be placed on the command line. If you're using the command line, don't use -i. また、*.blg などのワイルドカードを使用して、一度に複数の入力ファイル名を指定することもできます。 |
-q | 入力ファイルで指定されたログ ファイルのパフォーマンス カウンターと時間範囲を表示します。 |
-y | すべての質問に対する "yes" に応答することで、プロンプトをバイパスします。 |
/? | コマンド プロンプトにヘルプを表示します。 |
Remarks
カウンター パスの一般的な形式は、
[\<computer>] \<object>[<parent>\<instance#index>] \<counter>]
のようにします。この形式の親、インスタンス、インデックス、およびカウンター コンポーネントは、有効な名前またはワイルドカード文字のいずれかを含むことができます。 コンピューター、親、インスタンス、およびインデックス コンポーネントは、すべてのカウンターに必要ではありません。使用するカウンター パスを決定すると、自体カウンターに基づいています。 For example, the LogicalDisk object has an instance
<index>
, so you must provide the<#index>
or a wildcard. したがって、\LogicalDisk(*/*#*)\\*
の形式を使用できます。In comparison, the Process object doesn't require an instance
<index>
. したがって、\Process(*)\ID Process
の形式を使用できます。If a wildcard character is specified in the Parent name, all instances of the specified object that match the specified instance and counter fields will be returned.
If a wildcard character is specified in the Instance name, all instances of the specified object and parent object will be returned if all instance names corresponding to the specified index match the wildcard character.
If a wildcard character is specified in the Counter name, all counters of the specified object are returned.
部分的なカウンター パス文字列の一致 (たとえば、pro*) はサポートされていません。
カウンター ファイルは、1 つ以上の既存のログでのパフォーマンス カウンターを一覧表示されるテキスト ファイルです。 Copy the full counter name from the log or the /q output in
<computer>\<object>\<instance>\<counter>
format. 行ごとに 1 つのカウンター パスを一覧表示します。When run, the relog command copies specified counters from every record in the input file, converting the format if necessary. ワイルドカードのパスは、カウンター ファイルで許可されます。
Use the /t parameter to specify that input files are inserted into output files at intervals of every
nth
record. 既定では、すべてのレコードからデータがログされます。You can specify that your output logs include records from before the beginning time (that is, /b) to provide data for counters that require computation values of the formatted value. The output file will have the last records from input files with timestamps less than the /e (that is, end time) parameter.
The contents of the setting file used with the /config option should have the following format:
<commandoption>\<value>
, where<commandoption>
is a command line option and<value>
specifies its value.
##Q# Examples
固定の間隔 30 で既存のトレース ログを再サンプリングし、カウンターのパスをリストし、ファイルを出力し、フォーマットするには、次のように入力します。
relog c:\perflogs\daily_trace_log.blg /cf counter_file.txt /o c:\perflogs\reduced_log.csv /t 30 /f csv
固定の間隔 30 で既存のトレース ログを再サンプリングし、カウンターのパスをリストし、ファイルを出力するには、次のように入力します。
relog c:\perflogs\daily_trace_log.blg /cf counter_file.txt /o c:\perflogs\reduced_log.blg /t 30
既存のトレース ログをデータベースに再サンプリングするには、次のように入力します。
relog "c:\perflogs\daily_trace_log.blg" -f sql -o "SQL:sql2016x64odbc!counter_log"