0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Windows】Datadog AgentをインストールしてDatadogへログ収集する方法

Posted at

WindowsのDatadog Agentからログ収集方法

▼Datadog Agentとは

監視プラットフォームの中核をなすソフトウェアエージェント。
サーバー、仮想マシン、コンテナなどのホストにインストールされ、システムやアプリケーションのメトリクス、ログ、トレースなどのデータを収集し、Datadogプラットフォームに送信します。

▼簡単にやること

Datadogで監視したいサーバーにDatadog Agentをインストール、
Agent側から転送したいファイルをさくせい指定、Datadogコンソール上へ反映させる。

▼[Windows]Datadog Agentからログ収集手順詳細

①ログ収集したいホスト(サーバ等)からDatadog Agentを下記サイトからインストール

②ログ収集を「有効」にする

Datadog Agent では、ログの収集はデフォルトで無効のため、ログ収集を有効。
Agent のメインコンフィギュレーションファイル (datadog.yaml) で logs_enabled: false を logs_enabled: true に変更する

[②-1].下記ファイルパスを開く

C:\ProgramData\Datadog\datadog.yaml

[②-2].datadog.yamlファイルを変更する

datadog.yamlファイルを一部抜粋
・デフォルト(無効)

logs_enabled: false

・変更後(有効)

logs_enabled: true

▼各のOSメインコンフィギュレーション
https://docs.datadoghq.com/ja/agent/configuration/agent-configuration-files/

③sample.d\conf.yamlを作成

※sample.dはフォルダ
※conf.yamlはファイル

作成前
C:\ProgramData\Datadog\conf.d
作成後
C:\ProgramData\Datadog\conf.d\sample.d\conf.yaml

▼conf.yamlファイルの中身

logs:
  - type: file
    path: C:\Users\admin\Desktop\sample.json
    source: sample
    service: sample

※他必要なパラメータあれば適宜追加していく

▼パラメータリストは下記参照
https://docs.datadoghq.com/ja/agent/logs/?tab=tailfiles

④サービスでDatadogAgent再起動

[④-1].Windowsキー + Rキーを押して「ファイル名を指定して実行」ダイアログを開く

[④-2].「services.msc」と入力して「OK」をクリックします。

image.png

[④-3].「Datadog Agent」選択して右クリック、再起動実行。

image.png

⑤Datadogコンソール上でPipelineを作成

[⑤-1].Datadogコンソールへログイン

[⑤-2].左メニューの「Logs」にカーソル合わせ、Log Configurationの「Pipelines」を押下

image.png

[⑤-3].右上の「+New Pipeline」を選択

image.png

[⑤-4].Filterに「source:sample」を入力する。その他は適宜記入

※③で設定したconf.yamlファイルを認識して取得しています
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?