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.

Logstash mutate filterのドットの扱い

Last updated at Posted at 2020-06-04

Logstash filter mutate pluginとは

Logstashでログを加工する時に、必ず使うのが「filter plugin」
その中でも、「mutate」は、fieldを消したり、リネームしたり、追加したりなど利用することが多いが、ドットが付いているfieldはnestedデータとして扱われるので、そのままでは「mutate」を使うことができない。

やりたいこと

  • data1.data2 を data1 にしたい
  • data1.data2.data3 を data1.data2 にしたい
  • data1data2 を data1 にしたい

環境

  • logstash-7.7.0

OK

       mutate {
           rename  => { "[data1][data2]"  => "data1" }
           rename  => { "[data1][data2][data3]"  => "[data1][data2]" }
        }

NG

       mutate {
           rename  => { "data1.data2"  => "data1" }
           rename  => { "data1.data2.data3"  => "data1.data2" }
        }

OK

       mutate {
           rename  => { "data1data2"  => "data1" }
        }

Elastic document.

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?