Search word in body content

Dear,

I run into the problem of making a irule you find a word in the body of the page that loads and take an action.

Try something like this but does not work

September static :: errocuerpo “invalid”

} Elseif {[findstr [HTTP :: payload] $ static :: errocuerpo] == “invalid”} { log local0. “login fail” }

The method without static group are?

thanks

Try this:

set static::errocuerpo {invalid}

when HTTP_RESPONSE {
 if { [findstr [HTTP::payload] $static::errocuerpo] } {
    log local.0 "Login Fail"
 }
}

You can’t reference HTTP::payload until you have actively collected the content. You can then examine HTTP::payload within the HTTP_RESPONSE_DATA event. There is an example here https://devcentral.f5.com/wiki/irules.HTTP__collect.ashx.