Skip to content

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

Open
tossp wants to merge 4 commits intoIrineSistiana:mainfrom
tossp:statistics
Open

[Feature request] 导出查询日志#753
tossp wants to merge 4 commits intoIrineSistiana:mainfrom
tossp:statistics

Conversation

@tossp
Copy link
Copy Markdown

@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.

1 participant