1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | # cat configs/nginxpulse_config.json { "system": { "logDestination": "file", "taskInterval": "1m", "logRetentionDays": 30, "parseBatchSize": 100, "ipGeoCacheLimit": 1000000, "ipGeoApiUrl": "http://ip-api.com/batch", "demoMode": false, "accessKeys": [], "language": "zh-CN" }, "server": { "Port": ":8089" }, "database": { "driver": "postgres", "dsn": "postgres://nginxpulse:nginxpulse@127.0.0.1:5432/nginxpulse?sslmode=disable", "maxOpenConns": 10, "maxIdleConns": 5, "connMaxLifetime": "30m" }, "websites": [ { "name": "log-access", "logPath": "/share/log/nginx/access.log", "domains": [ "log-access" ] }, { "name": "slb-access", "logPath": "/share/log/nginx/slb-access.log", "domains": [ "slb-access" ], "logType": "nginx", "logRegex": "^(\\S+) - (?P<user>\\S+) \\[(?P<time>[^\\]]+)\\] \"(?P<method>\\S+) (?P<url>[^\"]+) HTTP/\\d\\.\\d\" (?P<status>\\d+) (?P<bytes>\\d+) \"(?P<referer>[^\"]*)\" \"(?P<ua>[^\"]*)\" \"(?P<ip>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})[^\"]*\" (\\S+) (\\S+)$" }, { "name": "proj-access", "domains": ["proj-access"], "logType": "nginx", "logRegex": "^(\\S+) - (?P<user>\\S+) \\[(?P<time>[^\\]]+)\\] \"(?P<method>\\S+) (?P<url>[^\"]+) HTTP/\\d\\.\\d\" (?P<status>\\d+) (?P<bytes>\\d+) \"(?P<referer>[^\"]*)\" \"(?P<ua>[^\"]*)\" \"(?P<ip>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})[^\"]*\" (\\S+) (\\S+)$", "sources": [ { "id": "proja-logs", "type": "local", "path": "/share/log/nginx/proja/proj.access.log", "compression": "auto" }, { "id": "projb-logs", "type": "local", "pattern": "/share/log/nginx/projb/proj.access*", "compression": "auto" } ] } ], "pvFilter": { "statusCodeInclude": [ 200 ], "excludePatterns": [ "favicon.ico$", "robots.txt$", "sitemap.xml$", "^/health$", "^/_(?:nuxt|next)/", "rss.xml$", "feed.xml$", "atom.xml$" ], "excludeIPs": [ "127.0.0.1", "::1" ] } } |
评论已关闭