Block connect with status and user and devieceid

i need help
i want to block connection with status code and user and devieceid.
i found this topic:

but this will add all connection to the stick table.
i need status 401 only.

What should I do?

it’s work now.

backend xxxxxx
 http-request set-header UserInfo %[urlp(User)]%[urlp(DeviceId)]
 stick store-request hdr(UserInfo) table Abuse
 http-request track-sc0 hdr(UserInfo) table Abuse
 http-request deny if { hdr(UserInfo),table_http_err_rate(Abuse) ge 5 }

 backend Abuse
 stick-table type string size 100K expire 30m store conn_rate(1s),http_req_rate(1s),http_err_rate(10s)"