BIG-IP : irule check cookie for value

f5 BIG-IP LTM VE v11.4.0 on ESXi

In an iRule , how to check that a request contains a specific cookie exists with a certain value ?

My iRule has conditional logic that should branch as a function of the value of a certain named cookie.

Example: if cookie “ab-test” has value “a” then route to pool-test-a , if “b” then route to pool-test-b , otherwise route to pool-primary

Check out this post for an example from Kevin.