New Relic Infrastrucure Agentは最近のリリースでNew Relic Logsへのログ送信機能が追加されました。これにより、ログ転送ソフトウェアのセットアップなしに、OS上のファイルなどをNew Relic Logsに送信できます。Windowsイベントログについてもサポートされるようになったので、紹介したいと思います。
手順はこちらのドキュメントにまとまっています。Infrastructure Agentをインストールします。Windowsの場合はMSI形式で提供されています。また、ログの転送機能を使う場合、最新のVisual C++再配布可能パッケージのインストールも必要です。
インストール後、C:\Program Files\New Relic\newrelic-infra\logging.d\
のフォルダに移動します。file.yml.example
のようなファイルがいくつかありますが、これがログ転送設定ファイルのサンプルです。Windowsイベントログについては、winlog
というキーワードで次のように指定します。
logs: - name: windows-security winlog: channel: Security collect-eventids: - 4624 - 4265 - 4700-4800 - 5000-5100 exclude-eventids: - 4735 - name: windows-application winlog: channel: Application
channel
はイベントログの名前を指定します。collect-eventids
を指定すると指定したイベントIDのイベントのみを転送します。exclude-eventids
を指定したイベントを除外することもできます。(exclude-eventidsのほうがcollect-eventidsより優先度が高いです)
これで、New Relic Logsでイベントログを見ることができます。
Windowsイベントログの他に、ファイルやTCP経由、またfluentbitの設定ファイルを指定する方法もGitHubで紹介されています。ぜひお試しください。
The views expressed on this blog are those of the author and do not necessarily reflect the views of New Relic. Any solutions offered by the author are environment-specific and not part of the commercial solutions or support offered by New Relic. Please join us exclusively at the Explorers Hub (discuss.newrelic.com) for questions and support related to this blog post. This blog may contain links to content on third-party sites. By providing such links, New Relic does not adopt, guarantee, approve or endorse the information, views or products available on such sites.