NGINX logging tab delimited format to syslog

Ekaterina Kukushkina ek at nginx.com
Thu Feb 25 23:25:14 UTC 2016


Hello CJ,


> On 26 Feb 2016, at 00:50, CJ Ess <zxcvbn4038 at gmail.com> wrote:
> 
> I would really like to output my nginx access log to syslog in a tab delimited format.
> 
> I'm using the latest nginx and rsyslogd 7.2.5
> 
> I haven't found an example of doing this, I'm wondering if/how to add tabs to the format in the log_format directive

Just use '\t' instead of ' ' in your log_format.
For example:
log_format tabbed '$remote_addr\t-\t$remote_user\t[$time_local]\t"$request"';

> 
> And also if there is anything I need to do to syslogd to pass through the tab characters.

By default, rsyslog convert control characters to their ASCII values (#011 in case
of Tab). You may prevent this behavior by setting $EscapeControlCharactersOnReceive
to off. 

> 
> Any help appreciated!
> 

--
Ekaterina Kukushkina



More information about the nginx mailing list