# NGINX logging tab delimited format to syslog

**URL:** <https://www.ruby-forum.com/t/nginx-logging-tab-delimited-format-to-syslog/244140>\
**Category:** NGINX\
**Created:** [February 25, 2016, 10:50pm UTC](https://www.ruby-forum.com/t/nginx-logging-tab-delimited-format-to-syslog/244140 "2016-02-25T22:50:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [February 25, 2016, 10:50pm UTC](https://www.ruby-forum.com/t/nginx-logging-tab-delimited-format-to-syslog/244140/1 "2016-02-25T22:50:38Z")

</div>

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

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

Any help appreciated!

---

<div class="post-metadata">

**Author:** ![CJ\_Ess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@CJ\_Ess](https://www.ruby-forum.com/u/CJ_Ess)\
**Post date:** [February 26, 2016, 12:25am UTC](https://www.ruby-forum.com/t/nginx-logging-tab-delimited-format-to-syslog/244140/2 "2016-02-26T00:25:52Z")

</div>

Hello CJ,

> On 26 Feb 2016, at 00:50, CJ Ess [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![CJ\_Ess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@CJ\_Ess](https://www.ruby-forum.com/u/CJ_Ess)\
**Post date:** [February 27, 2016, 8:47pm UTC](https://www.ruby-forum.com/t/nginx-logging-tab-delimited-format-to-syslog/244140/3 "2016-02-27T20:47:16Z")

</div>

Thank you! I’ve got it all set up now, thanks for the pointer to $  
EscapeControlCharactersOnReceive
