# Count the number of available servers in dynamic backend

**URL:** <https://discourse.haproxy.org/t/count-the-number-of-available-servers-in-dynamic-backend/1244>\
**Category:** Help!\
**Created:** [May 16, 2017, 9:10am UTC](https://discourse.haproxy.org/t/count-the-number-of-available-servers-in-dynamic-backend/1244 "2017-05-16T09:10:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swajm](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@swajm](https://discourse.haproxy.org/u/swajm)\
**Post date:** [May 16, 2017, 9:10am UTC](https://discourse.haproxy.org/t/count-the-number-of-available-servers-in-dynamic-backend/1244/1 "2017-05-16T09:10:58Z")

</div>

Hello,

Can you advise how to set the following ACL, especially nbsrv:

frontend webfarm  
bind 11.22.33.44:80  
…  
acl MAIN\_not\_enough\_capacity nbsrv([%[req.hdr(host),lower,map(/etc/haproxy/backend.map,bk\_default)]]) eq 0  
http-request redirect code 301 location [http://global-swajm.example.com](http://global-swajm.example.com) if MAIN\_not\_enough\_capacity  
use\_backend %[req.hdr(host),lower,map(/etc/haproxy/backend.map,bk\_default)]

use\_backend is working perfectly,but I don’t know how to set the same expression for nbsrv:  
nbsrv([%[req.hdr(host),lower,map(/etc/haproxy/backend.map,bk\_default)]])

This is the error which haproxy returns when I try to restart:  
error detected while parsing ACL ‘MAIN\_not\_enough\_capacity’ : missing comma after conv keyword ‘map’ in ACL expression ‘nbsrv([%[req.hdr(host),lower,map(/etc/haproxy/backend.map,bk\_default)]])’.

//haproxy version is 1.6.11.

Thanks!
