[ 
https://issues.apache.org/jira/browse/TS-2576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yunkai Zhang updated TS-2576:
-----------------------------

    Description: 
By default, we use white space ' ' as delimiter in LogFormat:
{code}
<LogFormat>
  <Name = "Cdn_access_log"/>
  <Format = "%<cqhm> %<cquuc> %<pscl> %<psql> %<crc> %<fsi>"/>
</LogFormat>
{code}

Of course, we could use other characters, such as comma(',') or any other 
visible character or string.

But we found that, the value of fields may contain the same delimiter 
characters, it would case hard to extract from log file.

So I develop a patch, it will introduce Oct/Hex escape sequences representation 
in LogFormat, for example:
{code}
<LogFormat>
  <Name = "Cdn_access_log"/>
  <Format = 
"%<cqhm>\001\002%<cquuc>\001\002%<pscl>\001\002%<psql>\001\002%<crc>\001\002%<fsi>"/>
</LogFormat>
{code}
In the above example, '\001\002' are two characters: '\001', '\002' in Oct 
escape sequence representation.

This patch now supports two forms(the same with the format in C lauguage):
* Oct escape sequence:
{code}
'\abc': a,b,c should be one of [0-9], and (a*8^2 + b*8 + c) should less then 
255.
{code}
* Hex escape sequence:
{code}
'\xab': a,b should one [0-9, a-f, A-F], and (a*16 + b) should less then 255.
{code}

  was:
By default, we use white space ' ' as delimiter in LogFormat:
{code}
<LogFormat>
  <Name = "Cdn_access_log"/>
  <Format = "%<cqhm> %<cquuc> %<pscl> %<psql> %<crc> %<fsi>"/>
</LogFormat>
{code}

Of course, we could use other characters, such as comma(',') or any other 
visible character or string.

But we found that, the value of fields may conation the same delimiter 
characters, it would case hard to extract from log file.

So I develop a patch, it will introduce Oct/Hex escape sequences representation 
in LogFormat, for example:
{code}
<LogFormat>
  <Name = "Cdn_access_log"/>
  <Format = 
"%<cqhm>\001\002%<cquuc>\001\002%<pscl>\001\002%<psql>\001\002%<crc>\001\002%<fsi>"/>
</LogFormat>
{code}
In the above example, '\001\002' are two characters: '\001', '\002' in Oct 
escape sequence representation.

This patch now supports two forms(the same with the format in C lauguage):
* Oct escape sequence:
{code}
'\abc': a,b,c should be one of [0-9], and (a*8^2 + b*8 + c) should less then 
255.
{code}
* Hex escape sequence:
{code}
'\xab': a,b should one [0-9, a-f, A-F], and (a*16 + b) should less then 255.
{code}


> Add Oct/Hex escape representation into LogFormat
> ------------------------------------------------
>
>                 Key: TS-2576
>                 URL: https://issues.apache.org/jira/browse/TS-2576
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Logging
>            Reporter: Yunkai Zhang
>
> By default, we use white space ' ' as delimiter in LogFormat:
> {code}
> <LogFormat>
>   <Name = "Cdn_access_log"/>
>   <Format = "%<cqhm> %<cquuc> %<pscl> %<psql> %<crc> %<fsi>"/>
> </LogFormat>
> {code}
> Of course, we could use other characters, such as comma(',') or any other 
> visible character or string.
> But we found that, the value of fields may contain the same delimiter 
> characters, it would case hard to extract from log file.
> So I develop a patch, it will introduce Oct/Hex escape sequences 
> representation in LogFormat, for example:
> {code}
> <LogFormat>
>   <Name = "Cdn_access_log"/>
>   <Format = 
> "%<cqhm>\001\002%<cquuc>\001\002%<pscl>\001\002%<psql>\001\002%<crc>\001\002%<fsi>"/>
> </LogFormat>
> {code}
> In the above example, '\001\002' are two characters: '\001', '\002' in Oct 
> escape sequence representation.
> This patch now supports two forms(the same with the format in C lauguage):
> * Oct escape sequence:
> {code}
> '\abc': a,b,c should be one of [0-9], and (a*8^2 + b*8 + c) should less then 
> 255.
> {code}
> * Hex escape sequence:
> {code}
> '\xab': a,b should one [0-9, a-f, A-F], and (a*16 + b) should less then 255.
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to