ログ自動検出拡張機能の統合

注: 地域のサポートまたはスケール要件に関してご質問やご不明な点がございましたら、カスタマーサポートにお問い合わせください。

ログ自動検出拡張機能を使用すると、スタンドアロン マシン エージェントに対する Analytics エージェント拡張機能とともにマシンエージェントを使用して、ログファイルを自動的に検出してモニターすることができます。Unix および Windows オペレーティングシステムをサポートすることを目的としています(Windows のサポートは異なる場合があります)。この拡張機能を使用すると、次のことができます。

  • 特定の文字列に一致するプロセスの開いているログファイル、または文字列に一致する特定のディレクトリ内のファイルを識別します。
  • 見つかったログファイルのサンプルをテストして、ファイルタイプを判別します。
  • Analytics エージェント ジョブ ディレクトリにログファイル用の新しいジョブファイルを作成します。このジョブファイルは、これらのルールに基づいてモニタリングを開始するよう Analytics エージェントに通知します。
  • マシンエージェントのシャットダウン時に、生成されたすべてのジョブファイルを自動的に削除します。これにより、アプリケーションプロセスと、関連するログファイルの再検出、および更新されたログファイルのメッセージ形式の一致が可能になります。

このソリューションを使用すると、マシンエージェントを介してリアルタイムの自動ログ収集を実行できます。

注: モニター対象のログファイルはコントローラに表示されません。SELECT * FROM ログをクエリすると、ログとそのデータが Analytics ログスキーマに表示されます。「Analytics ログデータ」と「SELECT 句」を参照してください。

Add the Extension to the Machine Agent

  1. Download the Log Auto-Discovery Extension zip file.
  2. Unzip the file and copy the LogMonitor directory to the directory <machine_agent_home>/monitors/ of your Machine Agent.Do not placethe extension in the extensions directory of your Machine Agent.
  3. Create a monitor.xml configuration file for the Machine Agent. The monitor.xml file enables the Machine Agent to use an extension. See Create the monitor.xml File.
  4. Configure the monitor.xml file with the path to the extension's configuration file default-config.yml. (Note that the path is relative to the path stored in the environment variable $AGENT_HOME.)
    CODE
    <task-arguments>
    <argument name="config-file" is-required="true" default-value=“./default-config.yml” />
    </task-arguments>
  5. Configure the extension with the file default-config.yml that lives in the root directory of the extension.The following YAML example shows you the structure and provides descriptions as comments for the properties. Replace the placeholder text with your own Controller information as well as the regex patterns for your key words to identify log file paths.
    JSON
    #default configuration, this can be edited, and should be copied to a new file in case of upgrade
    grokDirectory: ./grok
    jobDirectory: ./jobs
    #we will create the job files here: {analyticsDirectory}/conf/job
    #this is optional, we will try and determine this automatically
    #analyticsDirectory: ../analytics-agent
    #operating system specific commands
    psCommand: "/bin/ps -ef"
    lsofCommand: "/usr/sbin/lsof -p %d"
    #windows would have these:
    #psCommand: pslist.exe
    #lsofCommand: "handle.exe -p %d"
    #to download pslist, https://download.sysinternals.com/files/PSTools.zip
    #to download handle.exe, https://download.sysinternals.com/files/Handle.zip
    process:
    - java
    - -Dappdynamics.com
    logs:
    - /var/log/*.log
    #optionally, you can exclude log files where the absolutely path matches a given regex pattern:
    #excludeLogs:
    #  - .*appdynamics.*
    注: Avoid using tab (\t) when editing YAML files. Splunk AppDynamics recommends using a YAML validator to validate the default-config.yml file.
  6. Restart the Machine Agent.

Use the Log Analytics Data

You can collect Log Analytics data from many types of log files, including instrumented and non-instrumented applications as well as infrastructure. Log Analytics can be used as a standalone component. You can search and analyze log data just as you do transaction data.

For more details about how to use the log data, see Using Analytics Data.