Forum Discussion

Maria123's avatar
Maria123
Icon for Altostratus rankAltostratus
Jun 24, 2021

illegal argument invoked from within "http::collect ...."

Can we collect the request payload using HTTP::collect, two times in two different iRules assigned to the same virtual server? or there will be any impact?

Do I need to use HTTP::release before collecting the second time?

 

The following TCL errors were coming , from the logging iRule

The following TCL error is coming intermittently

illegal argument invoked from within "http::collect ...."

 

May I know is it because in the logging iRule we tried to collect the payload again without releasing in the another iRule after payload collection. The TCL error was coming intermittently and we could see some successful payload logging from the same logging iRule also.

  • You may add HTTP::release in the irules and make the one irule you want to trigger first with priority. You may first test if you add the http::collect in the first priority irule event and http::release in the second priority irule event (also order your irule corectly as per the article).

     

    https://clouddocs.f5.com/api/irules/priority.html

     

     

     

    You may also upload the payload from the first irule in a table that the second irule can use but this could be too memory intensive depending on the payload lenght and number of requests:

     

     

    https://clouddocs.f5.com/api/irules/table.html

     

     

    https://support.f5.com/csp/article/K13033

  • I recently came across this issue when adding an iRule to mitigate log4j/spring4shell.

    You may want to apply a catch statement in your secondary iRule to avoid errors:

    if { $content_length > 0 } {
      if { [catch { HTTP::collect $content_length }] } {
        log local0. "data collection already in progress"
      } else {
        log local0. "collecting data 2"
      }
    }