# response collect error payload respond

**URL:** <https://community.f5.com/t/response-collect-error-payload-respond/23795>\
**Category:** Technical Forums\
**Tags:** irules, dev, devops, application-delivery\
**Created:** [February 6, 2012, 9:33pm UTC](https://community.f5.com/t/response-collect-error-payload-respond/23795 "2012-02-06T21:33:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shawno\_84086](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@shawno\_84086](https://community.f5.com/u/shawno_84086)\
**Post date:** [February 6, 2012, 9:33pm UTC](https://community.f5.com/t/response-collect-error-payload-respond/23795/1 "2012-02-06T21:33:59Z")

</div>

I have a stupid application that is throwing errors but using an http status of 200 to do so. I have written this irule snippet to replace the responses,

when HTTP\_RESPONSE {

if { [HTTP::status] == 200} {

HTTP::collect 50 }

}

when HTTP\_RESPONSE\_DATA {

if { [HTTP::payload] contains “reported an error” } {

HTTP::respond 404 }

}

and it works, but i’m curious about the HTTP::collect element. I have set it to 1 and set it to a million, and my connection doesn’t stall and it works and the response time is about the same. what is a recommended collection amount? what is the unit of measure for integers and this command? i’m assuming bytes.

Thanks,

Shawn

---

<div class="post-metadata">

**Author:** ![nitass](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nitass/32/2270_2.png) [@nitass](https://community.f5.com/u/nitass)\
**Post date:** [February 7, 2012, 2:49am UTC](https://community.f5.com/t/response-collect-error-payload-respond/23795/2 "2012-02-07T02:49:48Z")

</div>

i think we should collect only amount of data we need i.e. reported an error message. the length is in octets (8-bit bytes).
