I need a little help to transfer values from one plugin (CustomPlugin) to another plugin (TCP Log Plugin) to extend the logging with custom attributes.
I wrote a CustomPlugin (see listing) where I try to set a value in kong.ctx.shared.myvalue as I understood from the documentation that this is the preferred way to hand over data from one to another plugin.
local BasePlugin = require "kong.plugins.base_plugin" local CustomHandler = BasePlugin:extend() local kong = kong CustomHandler.PRIORITY = 15 CustomHandler.VERSION = "1.0.0" function CustomHandler:log(conf) kong.ctx.shared.myvalue = true end return CustomHandler
Unfortunately, when I try to access the data from the TCP Log Plugin via
kong.ctx.shared.myvalue, it is nil.
Can anybody help me out? Thank you very much in advance.