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

More than 5 years have passed since last update.

AWS firelens(Fluent Bit)でログを分割する方法と複数の場所に転送する方法

Posted at

aws firelensを使って、ECSのログ収集をする時に以下のような複雑なことをやろうとする場合は自前でfluent bitの設定を変更する必要があって、具体的にはfluent bitの設定を自分で定義してそれを読み込んだコンテナを用意する必要があります。

  • 複数の場所にログを転送する
  • ログを分割する

やり方

extra.confを用意して、用意したファイルを読み込んだコンテナを作成する。
コンテナの作成の仕方はこちらを参照してください。
この記事ではextra.confの書き方だけを残しています。

# cw logs
[OUTPUT]
    Name cloudwatch
    Match   *
    region us-east-1
    log_group_name fluent-bit-cloudwatch
    log_stream_prefix from-fluent-bit-
    auto_create_group true

# kinesis
[OUTPUT]
    Name   firehose
    Match  *
    region us-west-2
    delivery_stream stream-one

[OUTPUT]
    Name   firehose
    Match  *
    region us-west-2
    delivery_stream stream-two

Matchの正規表現を作り込むことで例えば、ログレベルごとにログを収集することができます。
また[OUTPUT]を複数定義することで複数の場所にログを転送することができます。

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