{ "uid": "tailscale-proxy", "title": "Tailscale прокси — трафик LAN", "tags": [ "proxy", "tailscale", "loki" ], "schemaVersion": 39, "version": 2, "editable": true, "refresh": "30s", "time": { "from": "now-6h", "to": "now" }, "timezone": "", "templating": { "list": [ { "name": "datasource", "type": "datasource", "query": "loki", "current": {}, "hide": 0, "refresh": 1, "includeAll": false, "multi": false, "regex": "" } ] }, "annotations": { "list": [] }, "panels": [ { "id": 1, "type": "row", "title": "HTTP-прокси (:3128) — tinyproxy", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "panels": [] }, { "id": 2, "type": "stat", "title": "Всего запросов", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 4, "w": 8, "x": 0, "y": 1 }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "none", "textMode": "auto", "justifyMode": "auto" }, "fieldConfig": { "defaults": { "color": { "mode": "fixed", "fixedColor": "blue" }, "unit": "short" }, "overrides": [] }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(count_over_time({source_ip=\"192.168.0.35\"} |= \"Request (file descriptor\" [$__range]))", "refId": "A", "queryType": "instant" } ] }, { "id": 3, "type": "stat", "title": "Уникальных клиентов", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 4, "w": 8, "x": 8, "y": 1 }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "none", "textMode": "auto", "justifyMode": "auto" }, "fieldConfig": { "defaults": { "color": { "mode": "fixed", "fixedColor": "blue" }, "unit": "short" }, "overrides": [] }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "count(sum by (client)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Connect (file descriptor\" | pattern \"<_>): \" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 4, "type": "stat", "title": "Уникальных назначений", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 4, "w": 8, "x": 16, "y": 1 }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "none", "textMode": "auto", "justifyMode": "auto" }, "fieldConfig": { "defaults": { "color": { "mode": "fixed", "fixedColor": "blue" }, "unit": "short" }, "overrides": [] }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "count(sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Found upstream proxy\" | pattern \"<_>for \" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 5, "type": "timeseries", "title": "Запросы по методам", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 5 }, "fieldConfig": { "defaults": { "custom": { "drawStyle": "line", "fillOpacity": 15, "stacking": { "mode": "normal", "group": "A" } }, "unit": "cps" }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum by (method)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Request (file descriptor\" | pattern \"<_>): <_>\" [$__auto]))", "refId": "A", "queryType": "range", "legendFormat": "{{method}}" } ] }, { "id": 6, "type": "table", "title": "Топ назначений", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 9, "w": 12, "x": 0, "y": 13 }, "options": { "showHeader": true, "sortBy": [ { "displayName": "запросов", "desc": true } ] }, "fieldConfig": { "defaults": { "custom": { "align": "auto", "filterable": true } }, "overrides": [] }, "transformations": [ { "id": "labelsToFields", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "dest": "dest", "Value #A": "запросов", "Value": "запросов" } } } ], "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "topk(15, sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Found upstream proxy\" | pattern \"<_>for \" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 7, "type": "table", "title": "Топ клиентов", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 9, "w": 12, "x": 12, "y": 13 }, "options": { "showHeader": true, "sortBy": [ { "displayName": "запросов", "desc": true } ] }, "fieldConfig": { "defaults": { "custom": { "align": "auto", "filterable": true } }, "overrides": [] }, "transformations": [ { "id": "labelsToFields", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "client": "client", "Value #A": "запросов", "Value": "запросов" } } } ], "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "topk(15, sum by (client)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Connect (file descriptor\" | pattern \"<_>): \" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 8, "type": "logs", "title": "Журнал доступа HTTP (live)", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 22 }, "options": { "showTime": true, "wrapLogMessage": false, "enableLogDetails": true, "dedupStrategy": "none", "sortOrder": "Descending" }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "{source_ip=\"192.168.0.35\"} |= \"Request (file descriptor\"", "queryType": "range", "refId": "A" } ] }, { "id": 9, "type": "row", "title": "SOCKS5-прокси (:1080) — 3proxy", "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 31 }, "panels": [] }, { "id": 10, "type": "stat", "title": "Всего соединений", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 4, "w": 8, "x": 0, "y": 32 }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "none", "textMode": "auto", "justifyMode": "auto" }, "fieldConfig": { "defaults": { "color": { "mode": "fixed", "fixedColor": "purple" }, "unit": "short" }, "overrides": [] }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \" [$__range]))", "refId": "A", "queryType": "instant" } ] }, { "id": 11, "type": "stat", "title": "Уникальных клиентов", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 4, "w": 8, "x": 8, "y": 32 }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "none", "textMode": "auto", "justifyMode": "auto" }, "fieldConfig": { "defaults": { "color": { "mode": "fixed", "fixedColor": "purple" }, "unit": "short" }, "overrides": [] }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "count(sum by (clientip)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \" | pattern \" : <_>\" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 12, "type": "stat", "title": "Уникальных назначений", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 4, "w": 8, "x": 16, "y": 32 }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "none", "textMode": "auto", "justifyMode": "auto" }, "fieldConfig": { "defaults": { "color": { "mode": "fixed", "fixedColor": "purple" }, "unit": "short" }, "overrides": [] }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "count(sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \" | pattern \"<_> CONNECT \" | dest != \"0.0.0.0:0\" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 13, "type": "timeseries", "title": "Соединения во времени", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 36 }, "fieldConfig": { "defaults": { "custom": { "drawStyle": "line", "fillOpacity": 15, "stacking": { "mode": "none", "group": "A" } }, "unit": "cps" }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \" [$__auto]))", "refId": "A", "queryType": "range", "legendFormat": "соединения" } ] }, { "id": 14, "type": "timeseries", "title": "Трафик клиенту (байт/интервал)", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 36 }, "fieldConfig": { "defaults": { "custom": { "drawStyle": "line", "fillOpacity": 15, "stacking": { "mode": "none", "group": "A" } }, "unit": "bytes" }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(sum_over_time({source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \" | pattern \" <_>\" | unwrap bout [$__auto]))", "refId": "A", "queryType": "range", "legendFormat": "байт" } ] }, { "id": 15, "type": "table", "title": "Топ назначений", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 9, "w": 12, "x": 0, "y": 44 }, "options": { "showHeader": true, "sortBy": [ { "displayName": "соединений", "desc": true } ] }, "fieldConfig": { "defaults": { "custom": { "align": "auto", "filterable": true } }, "overrides": [] }, "transformations": [ { "id": "labelsToFields", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "dest": "dest", "Value #A": "соединений", "Value": "соединений" } } } ], "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "topk(15, sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \" | pattern \"<_> CONNECT \" | dest != \"0.0.0.0:0\" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 16, "type": "table", "title": "Топ клиентов", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 9, "w": 12, "x": 12, "y": 44 }, "options": { "showHeader": true, "sortBy": [ { "displayName": "соединений", "desc": true } ] }, "fieldConfig": { "defaults": { "custom": { "align": "auto", "filterable": true } }, "overrides": [] }, "transformations": [ { "id": "labelsToFields", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "clientip": "clientip", "Value #A": "соединений", "Value": "соединений" } } } ], "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "topk(15, sum by (clientip)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \" | pattern \" : <_>\" [$__range])))", "refId": "A", "queryType": "instant" } ] }, { "id": 17, "type": "logs", "title": "Журнал доступа SOCKS5 (live)", "datasource": { "type": "loki", "uid": "${datasource}" }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 53 }, "options": { "showTime": true, "wrapLogMessage": false, "enableLogDetails": true, "dedupStrategy": "none", "sortOrder": "Descending" }, "targets": [ { "datasource": { "type": "loki", "uid": "${datasource}" }, "editorMode": "code", "expr": "{source_ip=\"192.168.0.35\"} |~ \" 1080 [0-9]{5} \"", "queryType": "range", "refId": "A" } ] } ] }