CEL Selector

CEL estands for Common Expression Language, and provides a way to define complex conditions to be evaluated efficiently.

Learn more about CEL at cel.dev/ You can test your CEL Expression online using the CEL Playground.

The CEL behaviour selector allows to choose some chain of behaviours to be applied based on the conditions you want.

When none of the conditions are true, the selector falls back to whatever behaviour you define in the default key.

{
    "name": "cel_behaviour_selector",
    "config": {
        "default": [],
        "conditionals": [
          {
            "expr": "request.Header[?'Slow'][?0].value() == 'yes'",
            "behaviour": [
              {
                "name": "slower",
                "config": {
                  "max_bytes_per_second": 100,
                  "flush_bytes": 2
                }
              }
            ]
          },
          {
            "expr": "request.Header[?'Slow'][?0].value() == 'alot'",
            "behaviour": [
              {
                "name": "slower",
                "config": {
                  "max_bytes_per_second": 1,
                  "flush_bytes": 1
                }
              }
            ]
          }
        ]
    }
}