How do I use "Custom Fields by Lua" for `file-log` plugin?

Hello, I’m using Kong Gateway OSS (2.3.x). I’d like to customize the contents logged by the file-log plugin.

I found the following on its docs page: “The custom_fields_by_lua configuration allows for the dynamic modification of log fields using Lua code.”

What I tried is the following based on the admin-api

curl -v \
  -X POST \
  --data 'name=file-log' \
  --data 'config.path=/tmp/file.log' \
  --data 'config.custom_fields_by_lua.route="return nil"' \

and I receive “schema violation (config.custom_fields_by_lua: unknown field)”. Does anyone know how to use custom_fields_by_lua? Thanks!

© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ