13

How can we easily transform with fluentd( and plugins ) something like this

{
    "remote": "87.85.14.126",
    "city": "saint-hubert"
}

To this:

{
   "geoip": {
       "remote": "87.85.14.126",
       "city": "saint-hubert"
   }
}

Thank you

Florent Valdelievre
  • 1,546
  • 3
  • 20
  • 32

1 Answers1

7

Based on the answer by repeatedly(https://github.com/repeatedly).

<filter test.**>
  @type record_transformer
  enable_ruby true
  auto_typecast true

  <record>
    geoip ${{"remote" => "${remote}", "city" => "${city}"}}
  </record>
</filter>
Haoyuan Ge
  • 3,379
  • 3
  • 24
  • 40