LoginSignup
3
2

More than 3 years have passed since last update.

【Logstash】FileBeat Modulesとの併用

Last updated at Posted at 2019-10-17

概要

Filebeat ModulesとLogstashを併用する構成を考えます。
ログのパースを行う場所をどこにするかによって構成が変わります。

一番簡単なのはログのパースをIngest Pipelineで行う構成ですが、LogstashのFilterを使う構成だとIngestPipelineではできない処理(フィールドの削除等)が可能になります。

Filebeat Modulesの仕組み

FileBeat ModulesはIngest Pipelineを作成します。
ログの整形・加工はElasticSearchのIngest Nodeが担当します。

pipelineは以下のコマンドで作成できます。

filebeat setup --pipelines --modules nginx,system

確認は以下のコマンド

GET _ingest/pipeline/*

image.png

構成

構成1:パースをIngest Pipelineで行う

パースはESのIngest Pipelineで行う構成です。
LogstashのConfigにはFilterは入れず、Input, Outputのみです。

image.png

構成2:パースをLogstashで行う

パースはLogstashのFilterで行う構成です。
IngestPipelineではできない処理(フィールドの削除等)が可能になります。

ただしModuleの定義はCollect部分(どのパスのファイルを収集するか等)しか使わないため、Filterは自分で定義する必要があります。

image.png

3
2
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
3
2