{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": true,
  "panels": [
    {
      "datasource": {
        "type": "victoriametrics-logs-datasource",
        "uid": "${DS_VICTORIALOGS}"
      },
      "description": "显示当前筛选条件下的日志流量，用于确认是否有数据",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 80,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "victoriametrics-logs-datasource",
            "uid": "${DS_VICTORIALOGS}"
          },
          "expr": "_stream:{kubernetes.namespace_name=~\"$namespace\", kubernetes.pod_name=~\"$pod\"} AND $search | stats by (_time:1m) count()",
          "refId": "A"
        }
      ],
      "title": "🟢 实时流量脉冲 (Live Volume)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "victoriametrics-logs-datasource",
        "uid": "${DS_VICTORIALOGS}"
      },
      "gridPos": {
        "h": 21,
        "w": 24,
        "x": 0,
        "y": 3
      },
      "id": 2,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": false
      },
      "targets": [
        {
          "datasource": {
            "type": "victoriametrics-logs-datasource",
            "uid": "${DS_VICTORIALOGS}"
          },
          "expr": "_stream:{kubernetes.namespace_name=~\"$namespace\", kubernetes.pod_name=~\"$pod\"} AND $search",
          "refId": "A"
        }
      ],
      "title": "📜 实时日志流 (Real-time Logs)",
      "type": "logs"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [
    "realtime",
    "logs",
    "simple"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": true,
          "text": ".*",
          "value": ".*"
        },
        "description": "输入 .* 查看所有，或输入具体 Namespace",
        "hide": 0,
        "label": "Namespace",
        "name": "namespace",
        "options": [
          {
            "selected": true,
            "text": ".*",
            "value": ".*"
          }
        ],
        "query": ".*",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {
          "selected": true,
          "text": ".*",
          "value": ".*"
        },
        "description": "输入 .* 查看所有，或输入 Pod 关键词",
        "hide": 0,
        "label": "Pod Name",
        "name": "pod",
        "options": [
          {
            "selected": true,
            "text": ".*",
            "value": ".*"
          }
        ],
        "query": ".*",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {
          "selected": false,
          "text": "*",
          "value": "*"
        },
        "description": "全文搜索，输入 * 查看所有",
        "hide": 0,
        "label": "🔍 Search",
        "name": "search",
        "options": [
          {
            "selected": true,
            "text": "*",
            "value": "*"
          }
        ],
        "query": "*",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-15m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "1s",
      "5s",
      "10s",
      "30s",
      "1m"
    ]
  },
  "timezone": "",
  "title": "Pure Live Logs (Real-time)",
  "uid": null,
  "version": 0,
  "weekStart": "",
  "__inputs": [
    {
      "name": "DS_VICTORIALOGS",
      "label": "VictoriaLogs Data Source",
      "description": "Select your VictoriaMetrics Logs datasource",
      "type": "datasource",
      "pluginId": "victoriametrics-logs-datasource",
      "pluginName": "VictoriaMetrics Logs"
    }
  ]
}