Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the rules do not take effect. #51

Closed
kamly opened this issue Sep 21, 2023 · 0 comments
Closed

the rules do not take effect. #51

kamly opened this issue Sep 21, 2023 · 0 comments

Comments

@kamly
Copy link

kamly commented Sep 21, 2023

in the apisix v3.5.0 use file-logger plugins

i use match feature

{
  "_meta": {
    "disable": false
  },
  "disable": false,
  "log_format": {
    "@timestamp": "$time_iso8601",
    "created_at": "$time_iso8601",
    "domain": "$host",
    "forward_ips": "$http_x_forwarded_for",
    "ip": "$http_x_real_ip",
    "method": "$request_method",
    "protocol": "$server_protocol",
    "referer": "$http_referer",
    "request": "$request",
    "request_time": "$request_time",
    "server_ip": "$server_addr",
    "size": "$body_bytes_sent",
    "status": "$status",
    "ua": "$http_user_agent",
    "upstream_addr": "$upstream_addr",
    "upstream_time": "$upstream_time",
    "uri": "$uri"
  },
  "match": [
    [
      [
        "uri",
        "in",
        [
          "/api/pageview",
          "/polyfill/polyfill.min.js"
        ]
      ]
    ]
  ],
  "path": "logs/nginx.log"
}

https://xxx.qq.com/api/pageview?ec=%E5%B7%A5%E4%BD%9C%E5%8F%B0-PC%E7%AB%AF logging
https://xxx.qq.com/polyfill/polyfill.min.js?features=default, logging
https://wj.qq.com/api/v2/account not logging

it work

but i add ! do not take effect

{
  "_meta": {
    "disable": false
  },
  "disable": false,
  "log_format": {
    "@timestamp": "$time_iso8601",
    "created_at": "$time_iso8601",
    "domain": "$host",
    "forward_ips": "$http_x_forwarded_for",
    "ip": "$http_x_real_ip",
    "method": "$request_method",
    "protocol": "$server_protocol",
    "referer": "$http_referer",
    "request": "$request",
    "request_time": "$request_time",
    "server_ip": "$server_addr",
    "size": "$body_bytes_sent",
    "status": "$status",
    "ua": "$http_user_agent",
    "upstream_addr": "$upstream_addr",
    "upstream_time": "$upstream_time",
    "uri": "$uri"
  },
  "match": [
    [
      [
        "uri",
        "!",
        "in",
        [
          "/api/pageview",
          "/polyfill/polyfill.min.js"
        ]
      ]
    ]
  ],
  "path": "logs/nginx.log"
}

https://xxx.qq.com/api/pageview?ec=%E5%B7%A5%E4%BD%9C%E5%8F%B0-PC%E7%AB%AF logging
https://xxx.qq.com/polyfill/polyfill.min.js?features=default, logging
https://wj.qq.com/api/v2/account logging

i hope

https://xxx.qq.com/api/pageview?ec=%E5%B7%A5%E4%BD%9C%E5%8F%B0-PC%E7%AB%AF not logging
https://xxx.qq.com/polyfill/polyfill.min.js?features=default, not logging
https://wj.qq.com/api/v2/account logging

@kamly kamly closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant