I need to add some custom data to log other than header values.

I need to include additional custom data in the log, beyond the header, such as metadata.

Hey there @kindhearted-deer, thanks for posting. To ensure the fastest resolution to your issue, please review the following and follow all the steps:

You can do that using the log_hooks helper:

-- IMPORTANT: This needs to be before defining shaper.
log_hooks:new_json {
  name = "webhook",
  -- log_parameters are combined with the name and
  -- passed through to kumo.configure_log_hook
  log_parameters = {
    headers = { 'Subject', 'From' },
    meta = { 'tenant', 'domain_id', 'customer_id' }
  },
  -- queue config are passed to kumo.make_queue_config.
  -- You can use these to override the retry parameters
  -- if you wish.
  -- The defaults are shown below.
  queue_config = {
    retry_interval = "1m",
    max_retry_interval = "20m",
  },
  -- The URL to POST the JSON to
  url = LOG_WEBHOOK_URL
}

Hi @faithful-ostrich @original-baboon Is ther any option to add message body & source ip to the log ?

For full body you’ll need to make an http request manually when the message is received. See Discord

I’m not sure but I think the source address is available as peer_address in the log entry sent by log_hooks:new_json()

Logging message body will come with significant performance impact, we are not meant to be a message archiver, you may want to just bcc a copy to one.

And yes, source IP is already logged at reception.

If you need to log the entire body, you should BCC to an archived instead.