Cannot parse log_summary data - Rails

We implemented a custom company_transaction_id attribute to be added to each log of our application (we use Lograge and its custom_payload method for that). It is included in the log_summary attribute column in the Logs UI, and in a message.company_transaction_id attribute column. We would like to have it at the root of the log data in a company_transaction_id attribute column.

It seems that the log summary line issued at the end of Rails requests is considered as the message payload by the New Relic Agent though.

We have seen that custom parsing rules can be added, but it seems that it is only applicable to the message column. We couldn’t parse the data of the log_summary column.

Did we miss something? Do you have ideas on how we could fix this?

Many thanks for the help

# Example of log summary line
{"method":"GET","path":"/en/tours","format":"html","controller":"ToursController","action":"index","status":200,"duration":5266.62,"view":5129.3,"db":66.67,"params":{"locale":"en"},"host":"localhost","user_id":565,"locale":"en","company_transaction_id":"9143c008-73c2-4230-a02d-db66ed16f218"}

# Our config
config.log_formatter = NewRelic::Agent::Logging::DecoratingFormatter.new

config.lograge.enabled = true
config.lograge.formatter = Lograge::Formatters::Json.new

config.lograge.base_controller_class = ['ActionController::API', 'ActionController::Base']
config.lograge.keep_original_rails_log = false

config.lograge.custom_payload do |controller|
  {
    host: controller.request.host,
    user_id: controller.try(:current_user).try(:id),
    locale: I18n.locale,
    company_transaction_id: controller.try(:company_transaction_id)
  }
end

Hey there @monitoring-infra,

I hope you are well and I apologize for the delayed response. It is great to see you in the community again however!

I just wanted to follow up and let you know we see your question and are working to support you. While your request is a bit out of my area of expertise I am looping in a specialist from our logging team to help out! We appreciate your patience while we work through this. Please let us know if you have any other questions and we will be happy to help!

Hey @monitoring-infra,

Thanks for your patience!

If the company_transaction_id is coming through as message.company_transaction_id, then you should be able to use a custom parsing rule to parse it out.

Can you send me a link or screenshot of some logs where you are experiencing this issue?