We are using this syntax in our nginx configuration:
set $logging 1; if ( $bot_in_log = 0 ) { set $logging 0; } if ( $ip_in_log = 0 ) {