Skip to content

request help: How to deal with arg with dash in the plugin's setting #4519

Description

@nanamikon

Issue description

Some plugins support vars matching, such as traffic-split.

"plugins": {
        "traffic-split": {
            "rules": [
                {
                    "match": [
                        {
                            "vars": [
                                ["arg_name","==","test"]
                            ]
                        }
                    ],
                    "weighted_upstreams": [
                        {
                            "upstream": {
                                "name": "upstream_A",
                                "type": "roundrobin",
                                "nodes": {
                                    "127.0.0.1:1981":10
                                }
                            }
                        }
                    ]
                }
            ]
        }
    }

If I want to check an arg with dash (ex: test-name), I have to get this arg using regex from nginx.var.args refer to https://marc.info/?l=nginx&m=141589036701879&w=2.

So how to match this type of args in the plugin setting ? I can't get any tips from https://github.com/api7/lua-resty-expr#operator-list

Thank you

Environment

Request help without environment information will be ignored or closed.

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • luarocks version, if the issue is about installation (cmd: luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions