テキストログ監視機能では、監視対象フォルダに存在する特定のファイル名を持つファイルの更新を監視します。更新が あれば、更新分の内容を後述の監視サイトで設定したテキストログエラー条件、除外条件に基づいて判定します。
(1) テキストログ監視設定の追加
設定ツールの監視設定モードで以下のコマンドを実行し、メッセージに従って設定項目を入力します。追加されたテキス トログ監視設定はただちに動作に反映されます。
※1 この項目で使用可能な正規表現については以下の URL を参照して下さい。
http://docs.oracle.com/javase/jp/6/api/java/util/regex/Pattern.html
※2 監視対象サーバの環境変数 LANG に設定されている文字コードが使用されます。
上記の実行例では、「/var/log」フォルダに存在する、ファイル名が「sample.log」の正規表現に合致するファイルを監視 するように設定されます。
コマンド
add textlog
入力順 設定項目 備考
1 登録 CD 任意の値を設定する。
2 監視対象フォルダのフルパス 存在しないフォルダは指定不可。
3 監視対象ファイル名の正規表現(※1) 本項目に名前が合致するファイルが監視対象となる。
4 監視対象の説明 未入力でも可。
5 文字コード 以下から選択。
1:UTF-8 2:Shift-JIS 3:UTF-16BE 4:UTF-16LE 5:ASCII 6:EUC-JP 7:Auto(※)
実行例
Watch> add textlog
Please input registration code for a new textlog setting.
textlog> CD1
Please input full path of the target folder.
textlog> /var/log
Please input regular expression of the target file name.
textlog> sample.log
Please input description of the target file name. (If you don't need, proceed next.) textlog> サンプル設定
Please choose text encoding type of the target file name.
1.UTF-8 2.Shift-JIS 3.UTF-16BE 4.UTF-16LE 5.ASCII 6.EUC-JP 7.Auto textlog> 1
Added "TextLog Watching" target.
(2) テキストログ監視設定の表示
テキストログ監視設定の表示形式は、一覧表示と個別表示の 2 種類が用意されています。
① 一覧表示
設定ツールの監視設定モードで以下のコマンドを実行します。
② 個別表示
設定ツールの監視設定モードで以下のコマンドを実行します。<登録 CD>には、(1)でテキストログ監視設定を追加した際 に設定した登録 CD を指定します。
コマンド
show textlog
実行例
Watch> show textlog
"TextLog Watching" targets:
No. [registrationCD] [FolderPath] [FileNamePattern] [Validity]
1 CD1 /var/log sample.log true 2 CD2 /var/log sample2.log true
コマンド
show textlog <登録 CD>
実行例
Watch> show textlog CD1
Details of the registration code[CD1] are printed below.
[ FolderPath]
/var/log
[FileNamePattern]
sample.log [ Description]
サンプル設定 [ Text Encode Type]
UTF-8 [ Validity]
true
(3) テキストログ監視設定の有効/無効の切り替え
設定ツールの監視設定モードで以下のコマンドを実行します。本操作はテキストログ監視設定の内容を保持したまま一時 的に無効化したい場合に使用して下さい。操作結果はただちに動作に反映されます。
テキストログは 1 分間隔で監視され、後述の監視サイトで設定したテキストログエラー条件、除外条件に従って処理され ます。初期状態のエラー条件ではテキストログに“ERROR”の文言(大文字、小文字は無視)が含まれる場合、エラーとして います。
エラー条件、除外条件は 15 分ごとに更新を確認されます。監視サイトで設定した内容を即時反映したい場合は、App Bridge Monitor サービスを再起動して下さい。
大量のテキストファイルが監視対象となった場合、多くの CPU、メモリを消費する場合があります。全体の監視対象ファ イル数を 500 ファイル未満に抑えることを推奨します。
コマンド
switch textlog
実行例
Watch> switch textlog
"TextLog Watching" targets:
No. [registrationCD] [FolderPath] [FileNamePattern] [Validity]
1 CD1 /var/log sample.log true 2 CD2 /var/log sample2.log true
Please select a textlog watch setting to switch ON/OFF.
switch> 2
Textlog watch setting has been turned OFF.(RegCD:CD2)