ガバメントサイトでは、ログ転送はご利用いただけません。詳しくはアカウント担当者にお問い合わせください。

概要

ログ転送を使用すると、Datadog から Splunk、Elasticsearch、HTTP エンドポイントなどのカスタム宛先にログを送信することができます。つまり、ログパイプラインを使用して、Datadog でログを一元的に収集、処理、標準化することが可能です。その後、Datadog から他のツールにログを送信し、各チームのワークフローをサポートします。取り込まれたログは、インデックスの有無にかかわらず、カスタム宛先に転送することができます。ログは JSON 形式で転送され、GZIP で圧縮されます。

Note: Only Datadog users with the logs_write_forwarding_rules permission can create, edit, and delete custom destinations for forwarding logs.

ログ転送のページで、カスタム宛先がハイライト表示されています。宛先のリストには、Splunk (service:logs-processing でフィルタリング)、HTTP Endpoint (source:okta OR source:paloalto でフィルタリング)、Elasticsearch (team:acme env:prod でフィルタリング) が含まれています。

If a forwarding attempt fails (for example: if your destination temporarily becomes unavailable), Datadog retries periodically for 2 hours using an exponential backoff strategy. The first attempt is made following a 1-minute delay. For subsequent retries, the delay increases progressively to a maximum of 8-12 minutes (10 minutes with 20% variance).

次のメトリクスは、再試行後に正常に送信されたログなどの正常に転送されたログ、およびドロップされたログについて報告します。

  • datadog.forwarding.logs.bytes
  • datadog.forwarding.logs.count

カスタム宛先へのログ転送設定

  1. Add webhook IPs from the IP ranges list to the allowlist.
  2. ログ転送に移動します。
  3. Custom Destinations を選択します。
  4. New Destination をクリックします。
  5. 転送するログをフィルターするためのクエリを入力します。詳しくは、検索構文を参照してください。
  6. Destination Type を選択します。
The destination configuration page, showing the steps to set up a new destination.
  1. 宛先の名前を入力します。
  2. Define endpoint フィールドで、ログを送信するエンドポイントを入力します。エンドポイントは、https:// で始まる必要があります。
  3. Configure Authentication セクションで、以下の認証タイプのいずれかを選択し、関連する詳細を入力します。
    • Basic Authentication: ログの送信先となるアカウントのユーザー名とパスワードを入力します。
    • Request Header: ヘッダー名と値を指定します。例えば、Authorization ヘッダーを使用し、ログを送信するアカウントのユーザー名が myaccount で、パスワードが mypassword の場合:
      • Header NameAuthorization を入力します。
      • ヘッダー値は Basic username:password というフォーマットで、username:password は base64 でエンコードされています。この例では、ヘッダー値は Basic bXlhY2NvdW50Om15cGFzc3dvcmQ= となります。
  1. 宛先の名前を入力します。
  2. In the Configure Destination section, enter the endpoint to which you want to send the logs. The endpoint must start with https://. For example, enter https://<your_account>.splunkcloud.com:8088. Note: /services/collector/event is automatically appended to the endpoint.
  3. In the Configure Authentication section, enter the Splunk HEC token. See Set up and use HTTP Event Collector for more information about the Splunk HEC token. Note: The indexer acknowledgment needs to be disabled.
  1. 宛先の名前を入力します。
  2. Configure Destination セクションで、以下の内容を入力します。 a. ログを送信するエンドポイント。エンドポイントは https:// で始まらなければなりません。Elasticsearch のエンドポイント例: https://<your_account>.us-central1.gcp.cloud.es.io b. ログを送信する宛先インデックスの名前。 c. オプションで、新しいインデックスを作成する頻度を示すインデックスローテーションを選択します。No RotationEvery HourEvery DayEvery Week、または Every Month です。デフォルトは No Rotation です。
  3. Configure Authentication セクションで、Elasticsearch アカウントのユーザー名とパスワードを入力します。
  1. In the Select Tags to Forward section: a. Select whether you want All tags, No tags, or Specific Tags to be included. b. Select whether you want to Include or Exclude specific tags, and specify which tags to include or exclude.
  2. Save をクリックします。

Log Forwarding ページで、宛先のステータスにカーソルを合わせると、過去 1 時間に転送されたフィルターの条件に一致するログの割合が表示されます。

宛先を編集する

  1. ログ転送に移動します。
  2. Custom Destinations を選択すると、既存のすべての宛先のリストが表示されます。
  3. 編集したい宛先の Edit ボタンをクリックします。
  4. 構成ページで変更します。
  5. Save をクリックします。

宛先を削除する

  1. ログ転送に移動します。
  2. Custom Destinations を選択すると、既存のすべての宛先のリストが表示されます。
  3. 削除したい宛先の Delete ボタンをクリックし、Confirm をクリックします。これにより、設定されている宛先リストから宛先が削除され、ログが転送されなくなります。

参考資料

PREVIEWING: evan.li/clarify-agentless