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?

More than 3 years have passed since last update.

Elasticsearch > Filebeat > 標準のModuleにフィールドを追加する方法

Posted at

apacheモジュールの場合

module/apache/access/ingest/pipeline.ymlを編集する

スクリーンショット 2020-12-02 19.03.25.png

pipeline.yml

- set:
    field: event.addfield
    value: custom
    
- script:
    lang: painless
    ignore_failure: true
    source: >-
      def parts = ctx.url.original?.splitOnToken("?");
      if (parts.length != 2) {
        ctx.url.endpoint = ctx.url.original;
        return;
      }

      ctx.url.endpoint = parts[0];
      ctx.url.param = parts[1];

変更の反映

ここがドキュメントの深くにしか書いてなかったが、
https://www.elastic.co/guide/en/beats/devguide/7.10/filebeat-modules-devguide.html#_metafields_yml_2

pipeline.ymlを変更しただけではfilebeatのパイプラインに反映されない。
以下のコマンドで変更をfilebeatのfields.ymlに反映する

./filebeat setup --pipelines

実行する

./filebeat -e -c filebeat.yml
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?