Character encoding while logging custom log format in access log

Asked by manoj

I am using squid 4.0.21 with ecap version 1.0
I used to a custom access log format:
logformat customLogFormat %ts.%03tu %6tr %>a %ru %{status_info}adapt::<last_h

# TAG: access_log
access_log daemon:/usr/local/squid/var/logs/access.custom.log customLogFormat

ecap code for log the field %{status_info}adapt::<last_h is follows

string statusData;

 * @param visitor
void RequestAction::visitEachOption(libecap::NamedValueVisitor &visitor) const {

        visitor.visit(loggingStatus, Area(, statusData.size()));

void RequestAction::start()
     some codes here

                //pass the request as such.


But the squid access log is logged statusData as 12%5C33%5Ctesting instead of 12\33\testing
Squid logs the character '\' as %5C in access log. I need to log the filed %{status_info}adapt::<last_h as 12\33\testing

Could any one please help to resolve the issue

Question information

English Edit question
eCAP Edit question
No assignee Edit question
Solved by:
Alex Rousskov
Last query:
Last reply:
Revision history for this message
Best Alex Rousskov (rousskov) said :

This is not a question about eCAP. This is a question about Squid. Please use Squid support channels for further assistance.

Please also note that Squid logformat directive allows you to specify the encoding for most fields:

  % ["|[|'|#|/] [-] [[0]width] [{arg}] formatcode [{arg}]

  " output in quoted string format
  [ output in squid text log format as used by log_mime_hdrs
  # output in URL quoted format
  / output in shell \-escaped format
  ' output as-is

Revision history for this message
manoj (manojmaybe000) said :

Thanks Alex Rousskov, that solved my question.