Grafana dashboard: Container Log Quick Search
Description: Container/Pod Log Quick Search(Loki as DataSource)


{
  "__inputs": [
    {
      "name": "DS_LOKI",
      "label": "Loki",
      "description": "",
      "type": "datasource",
      "pluginId": "loki",
      "pluginName": "Loki"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.3.1"
    },
    {
      "type": "panel",
      "id": "logs",
      "name": "Logs",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "loki",
      "name": "Loki",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 16970,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1604784076394,
  "links": [],
  "panels": [
    {
      "datasource": "${DS_LOKI}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "gridPos": {
        "h": 24,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "showLabels": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": false
      },
      "targets": [
        {
          "expr": "{namespace=\"$namespace\", pod=~\"$pod\"} |~ \"(?i)$searchable_pattern\" ",
          "hide": false,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Search Result",
      "type": "logs"
    }
  ],
  "refresh": "1m",
  "schemaVersion": 34,
  "style": "dark",
  "tags": [
    "Loki",
    "logging"
  ],
  "templating": {
    "list": [
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "loki",
          "value": "loki"
        },
        "datasource": "${DS_LOKI}",
        "definition": "label_values({namespace=~\".+\"}, namespace)",
        "hide": 0,
        "includeAll": false,
        "label": "Namespace",
        "multi": false,
        "name": "namespace",
        "options": [],
        "query": "label_values({namespace=~\".+\"}, namespace)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_LOKI}",
        "definition": "label_values({namespace=\"$namespace\"}, pod)",
        "hide": 0,
        "includeAll": true,
        "label": "Pod",
        "multi": false,
        "name": "pod",
        "options": [],
        "query": "label_values({namespace=\"$namespace\"}, pod)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": true,
          "text": "",
          "value": ""
        },
        "hide": 0,
        "label": "Search (case insensitive)",
        "name": "searchable_pattern",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Container Log Quick Search",
  "uid": "7ecZpUkRk",
  "version": 2,
  "description": "Container/Pod Log Quick Search(Loki as DataSource)"
}