# Log if body\_size greater than

**URL:** <https://www.ruby-forum.com/t/log-if-body-size-greater-than/212728>\
**Category:** NGINX\
**Created:** [October 11, 2011, 11:25pm UTC](https://www.ruby-forum.com/t/log-if-body-size-greater-than/212728 "2011-10-11T23:25:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 11, 2011, 11:25pm UTC](https://www.ruby-forum.com/t/log-if-body-size-greater-than/212728/1 "2011-10-11T23:25:20Z")

</div>

Dear Users,

I’m reading through the docs and I’ve found that the rewrite module has  
some basic comparison operators. Is there a way or trick to implement  
some  
conditional processing at other parts of the configuration? My situation  
is that I’m serving a lot of files through nginx and I would like to be  
able to log the request if the file is bigger than a given size. I was  
thinking about using the $body\_size to log the actual size but I cannot  
implement the condition checking with the tools I know. Is there a way  
to  
achieve this with the current features of nginx?

Best regards,  
Mate
