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

[Feature request] 导出查询日志 #753

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tossp
Copy link

@tossp tossp commented Nov 7, 2023

好像改动有点大,不知道能否接受这样的埋点。

特别是为了记录上游服务器,对转发器forward的函数签名做了变更。

目前查询日志实时获取使用的长连接的方式,使用websocket更好,但是需要引用第三方库,暂未实现。

使用示例如下:

  1. 查询日志发送到https://123.com/mosdns.json
  2. 通过 /plugins/ssimple/statistics 实时获取查询日志
log:
  # level: warn
  level: debug
  # level: info

api:
  http: 0.0.0.0:8080

plugins:
  - tag: ssimple
    type: statistics_simple
    args:
      web_hook: https://123.com/mosdns.json

  - tag: cache
    type: cache
    args:
      size: 10240
      lazy_cache_ttl: 300

  - tag: 本地上游组
    type: forward
    args:
      concurrent: 1
      upstreams:
        - addr: 192.168.9.53
          tag: 本地
        - addr: 114.114.114.114
          tag: 114
     

  - tag: UDP序列
    type: sequence
    args:
      - exec: $ssimple
      - exec: $cache
      - matches: has_resp
        exec: accept
      - exec: $本地上游组

  # 启动监听服务
  - tag: udp
    type: udp_server
    args:
      entry: UDP序列
      listen: :53

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

Successfully merging this pull request may close these issues.

None yet

1 participant