Grafana dashboard: Kong http Logs
Description: Browse, analyze logs in Elasticsearchstatus_codes, pie-chart, top 10 clientip, line-chart,word-map and etc...

# tcp-log.yaml ( kong deployed in kubernets)
```
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: tcp-log
  labels:
    global: "true"
config:
  host: logstash.logstash
  port: 1514
plugin: tcp-log
```
# helm install logstash
values.yaml
```
replicaCount: 1

podDisruptionBudget:
  maxUnavailable: 1

updateStrategy:
  type: RollingUpdate

terminationGracePeriodSeconds: 30

image:
  repository: docker.elastic.co/logstash/logstash-oss
  tag: 6.7.0
  pullPolicy: IfNotPresent
  ## Add secrets manually via kubectl on kubernetes cluster and reference here
  #  pullSecrets:
  #    - name: "myKubernetesSecret"

service:
  type: ClusterIP
  # clusterIP: None
  # nodePort:
  # Set this to local, to preserve client source ip.  Default stripes out the source ip
  # externalTrafficPolicy: Local
  annotations: {}
    ## AWS example for use with LoadBalancer service type.
    # external-dns.alpha.kubernetes.io/hostname: logstash.cluster.local
    # service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
    # service.beta.kubernetes.io/aws-load-balancer-internal: "true"
  ports:
    # syslog-udp:
    #   port: 1514
    #   targetPort: syslog-udp
    #   protocol: UDP
     syslog-tcp:
       port: 1514
       targetPort: syslog-tcp
       protocol: TCP
    #beats:
    #  port: 5044
    #  targetPort: beats
    #  protocol: TCP
    # http:
    #  port: 8080
    #  targetPort: http
    #  protocol: TCP
    # loadBalancerIP: 10.0.0.1
ports:
  # - name: syslog-udp
  #   containerPort: 1514
  #   protocol: UDP
   - name: syslog-tcp
     containerPort: 1514
     protocol: TCP
  #- name: beats
  #  containerPort: 5044
  #  protocol: TCP
  # - name: http
  #   containerPort: 8080
  #   protocol: TCP

ingress:
  enabled: false
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  path: /
  hosts:
    - logstash.cluster.local
  tls: []
  #  - secretName: logstash-tls
  #    hosts:
  #      - logstash.cluster.local

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #  cpu: 100m
  #  memory: 128Mi
  # requests:
  #  cpu: 100m
  #  memory: 128Mi

priorityClassName: ""

nodeSelector: {}

tolerations: []

securityContext:
  fsGroup: 1000
  runAsUser: 1000

affinity: {}
  # podAntiAffinity:
  #   requiredDuringSchedulingIgnoredDuringExecution:
  #     - topologyKey: "kubernetes.io/hostname"
  #       labelSelector:
  #         matchLabels:
  #           release: logstash

podAnnotations: {}
  # iam.amazonaws.com/role: "logstash-role"
  # prometheus.io/scrape: "true"
  # prometheus.io/path: "/metrics"
  # prometheus.io/port: "9198"

podLabels: {}
  # team: "developers"
  # service: "logstash"

livenessProbe:
  httpGet:
    path: /
    port: monitor
  initialDelaySeconds: 20
  # periodSeconds: 30
  # timeoutSeconds: 30
  # failureThreshold: 6
  # successThreshold: 1

readinessProbe:
  httpGet:
    path: /
    port: monitor
  initialDelaySeconds: 20
  # periodSeconds: 30
  # timeoutSeconds: 30
  # failureThreshold: 6
  # successThreshold: 1

persistence:
  enabled: false
  ## logstash data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
  ##   GKE, AWS & OpenStack)
  ##
  # storageClass: "-"
  accessMode: ReadWriteOnce
  size: 2Gi

volumeMounts:
  - name: data
    mountPath: /usr/share/logstash/data
  - name: patterns
    mountPath: /usr/share/logstash/patterns
  - name: pipeline
    mountPath: /usr/share/logstash/pipeline

volumes: []
  # - name: tls
  #   secret:
  #     secretName: logstash-tls
  # - name: pipeline
  #   configMap:
  #     name: logstash-pipeline
  # - name: certs
  #   hostPath:
  #     path: /tmp

exporter:
  logstash:
    enabled: true
    image:
      repository: bonniernews/logstash_exporter
      tag: v0.1.2
      pullPolicy: IfNotPresent
    env: {}
    resources: {}
    path: /metrics
    port: 9198
    target:
      port: 9600
      path: /metrics
    livenessProbe:
      httpGet:
        path: /metrics
        port: ls-exporter
      periodSeconds: 15
      timeoutSeconds: 60
      failureThreshold: 8
      successThreshold: 1
    readinessProbe:
      httpGet:
        path: /metrics
        port: ls-exporter
      periodSeconds: 15
      timeoutSeconds: 60
      failureThreshold: 8
      successThreshold: 1

elasticsearch:
  host: elasticsearch-client.efk.svc.cluster.local
  port: 9200

## ref: https://github.com/elastic/logstash-docker/blob/master/build/logstash/env2yaml/env2yaml.go
config:
  config.reload.automatic: "true"
  path.config: /usr/share/logstash/pipeline
  path.data: /usr/share/logstash/data

  ## ref: https://www.elastic.co/guide/en/logstash/current/persistent-queues.html
  queue.checkpoint.writes: 1
  queue.drain: "true"
  queue.max_bytes: 1gb  # disk capacity must be greater than the value of `queue.max_bytes`
  queue.type: persisted

## Patterns for filters.
## Each YAML heredoc will become a separate pattern file.
patterns:
  # main: |-
  #   TESTING {"foo":.*}$

## NOTE: To achieve multiple pipelines with this chart, current best practice
## is to maintain one pipeline per chart release. In this way configuration is
## simplified and pipelines are more isolated from one another.

inputs:
  main: |-
    input {
      # udp {
      #   port => 1514
      #   type => syslog
      # }
       tcp {
         port => 1514
         type => syslog
         codec => json
       }
      #beats {
      #  port => 5044
      #}
      # http {
      #   port => 8080
      # }
      # kafka {
      #   ## ref: https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html
      #   bootstrap_servers => "kafka-input:9092"
      #   codec => json { charset => "UTF-8" }
      #   consumer_threads => 1
      #   topics => ["source"]
      #   type => "example"
      # }
    }

filters:
   main: |-
     filter {
       geoip {
         source => "client_ip"
       }
     }

outputs:
  main: |-
    output {
      stdout { codec => rubydebug }
      elasticsearch {
        hosts => ["${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}"]
        manage_template => true
        index => "logstash-kong-http-log-%{+YYYY.MM.dd}"
      }
      # kafka {
      #   ## ref: https://www.elastic.co/guide/en/logstash/current/plugins-outputs-kafka.html
      #   bootstrap_servers => "kafka-output:9092"
      #   codec => json { charset => "UTF-8" }
      #   compression_type => "lz4"
      #   topic_id => "destination"
      # }
    }
```
# helm install  elasticsearch
pass


{
  "__inputs": [
    {
      "name": "DS_KONG_HTTP LOG",
      "label": "kong http log",
      "description": "kong tcp log plugin trans data to logstash ,logstash trans to elasticsearch",
      "type": "datasource",
      "pluginId": "elasticsearch",
      "pluginName": "Elasticsearch"
    }
  ],
  "__requires": [
    {
      "type": "datasource",
      "id": "elasticsearch",
      "name": "Elasticsearch",
      "version": "5.0.0"
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.0.2"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.3.6"
    },
    {
      "type": "panel",
      "id": "grafana-worldmap-panel",
      "name": "Worldmap Panel",
      "version": "0.2.0"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "type": "dashboard"
      }
    ]
  },
  "description": "Browse, analyze logs in Elasticsearchstatus_codes, pie-chart, top 10 clientip, line-chart,word-map and etc...",
  "editable": true,
  "gnetId": 10162,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1557369880098,
  "links": [
    {
      "icon": "external link",
      "includeVars": false,
      "tags": [],
      "targetBlank": true,
      "title": "Kibana",
      "type": "link",
      "url": "http://39.96.180.43:30523/app/kibana#/discover/55ccd4c0-5aad-11e9-ad47-f10b8281f927?_g=()&_a=(columns:!(request.headers.host,request.headers.referer,request.method,request.size,request.uri,request.url,response.size,response.status),filters:!(),index:'910e4610-5aab-11e9-ad47-f10b8281f927',interval:auto,query:(language:lucene,query:''),sort:!('@timestamp',desc))"
    }
  ],
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 36,
      "panels": [],
      "repeat": null,
      "title": "汇总",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "rgba(50, 172, 45, 0.97)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(245, 54, 54, 0.9)"
      ],
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 6,
        "w": 3,
        "x": 0,
        "y": 1
      },
      "id": 17,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "80%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": true,
        "lineColor": "rgb(0, 4, 244)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "$inter",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "ip.keyword",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "thresholds": "300000,500000",
      "title": "请求总数",
      "type": "singlestat",
      "valueFontSize": "100%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "rgba(50, 172, 45, 0.97)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(245, 54, 54, 0.9)"
      ],
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 6,
        "w": 3,
        "x": 3,
        "y": 1
      },
      "id": 1,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "80%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": true,
        "lineColor": "rgb(0, 14, 245)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "$inter",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "client_ip.keyword",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "cardinality"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "thresholds": "10000,100000",
      "title": "IP访问数",
      "type": "singlestat",
      "valueFontSize": "100%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 6,
        "y": 1
      },
      "id": 3,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "sortDesc": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 2,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "response.status",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain HTTP 状态码",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 14,
        "y": 1
      },
      "id": 11,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 2,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "client_ip.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain IP TOP 10",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 11,
        "w": 6,
        "x": 0,
        "y": 7
      },
      "id": 30,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 4,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "geoip.city_name.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain 访问前十的城市",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 11,
        "w": 6,
        "x": 6,
        "y": 7
      },
      "id": 31,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 4,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "geoip.region_name.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain 访问前十的省份",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 11,
        "w": 6,
        "x": 12,
        "y": 7
      },
      "id": 32,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 4,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "geoip.country_name.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain 国家/地区访问占比",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 11,
        "w": 6,
        "x": 18,
        "y": 7
      },
      "id": 14,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 4,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "request.method.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain 请求方法占比",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "circleMaxSize": "10",
      "circleMinSize": "3",
      "colors": [
        "rgba(0, 247, 0, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(240, 4, 45, 0.97)"
      ],
      "datasource": "${DS_KONG_HTTP LOG}",
      "decimals": 0,
      "esGeoPoint": "geoip.location",
      "esLocationName": "",
      "esMetric": "Count",
      "gridPos": {
        "h": 15,
        "w": 24,
        "x": 0,
        "y": 18
      },
      "height": "600px",
      "hideEmpty": false,
      "hideZero": true,
      "id": 35,
      "initialZoom": "5",
      "links": [],
      "locationData": "geohash",
      "mapCenter": "custom",
      "mapCenterLatitude": "30",
      "mapCenterLongitude": "103",
      "maxDataPoints": 1,
      "mouseWheelZoom": false,
      "showLegend": true,
      "stickyLabels": false,
      "tableQueryOptions": {
        "geohashField": "geohash",
        "latitudeField": "latitude",
        "longitudeField": "longitude",
        "metricField": "metric",
        "queryType": "geohash"
      },
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "geoip.location",
              "id": "4",
              "settings": {
                "precision": 3
              },
              "type": "geohash_grid"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "thresholds": "100,1000",
      "title": "$domain Word Map",
      "transparent": true,
      "type": "grafana-worldmap-panel",
      "unitPlural": "",
      "unitSingle": "",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 33
      },
      "id": 12,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 1,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "request.uri.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain request top 10",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 44
      },
      "height": "300px",
      "id": 13,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 1,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "request.headers.referer.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain referer top 10",
      "transparent": true,
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {
        "500": "#BF1B00"
      },
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_KONG_HTTP LOG}",
      "editable": true,
      "error": false,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 52
      },
      "id": 16,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "maxPerRow": 1,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "request.headers.user-agent.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain user_agent top 10",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 63
      },
      "id": 37,
      "panels": [],
      "repeat": null,
      "title": "历史趋势",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_KONG_HTTP LOG}",
      "decimals": 0,
      "editable": true,
      "error": false,
      "fill": 0,
      "grid": {},
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 64
      },
      "id": 2,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "connected",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "$inter",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$domain 请求数",
      "tooltip": {
        "msResolution": true,
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {
        "404": "#3F2B5B",
        "499": "#890F02",
        "500": "#BF1B00"
      },
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_KONG_HTTP LOG}",
      "decimals": 0,
      "editable": true,
      "error": false,
      "fill": 1,
      "grid": {},
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 73
      },
      "id": 7,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "total": true,
        "values": true
      },
      "lines": false,
      "linewidth": 2,
      "links": [],
      "maxPerRow": 1,
      "nullPointMode": "connected",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "response.status",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_count",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "$inter",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "request.headers.host:$domain",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$domain HTTP 状态码",
      "tooltip": {
        "msResolution": true,
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": "状态码数量",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 82
      },
      "id": 38,
      "panels": [],
      "repeat": null,
      "title": "Dashboard Row",
      "type": "row"
    },
    {
      "columns": [
        {
          "text": "request.headers.host",
          "value": "request.headers.host"
        },
        {
          "text": "client_ip",
          "value": "client_ip"
        },
        {
          "text": "request.method",
          "value": "request.method"
        },
        {
          "text": "request.uri",
          "value": "request.uri"
        },
        {
          "text": "response.status",
          "value": "response.status"
        },
        {
          "text": "latencies.request",
          "value": "latencies.request"
        }
      ],
      "datasource": "${DS_KONG_HTTP LOG}",
      "fontSize": "100%",
      "gridPos": {
        "h": 13,
        "w": 24,
        "x": 0,
        "y": 83
      },
      "height": "500",
      "id": 33,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "link": false,
          "pattern": "/@time.*/",
          "type": "date"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "bucketAggs": [],
          "dsType": "elasticsearch",
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {
                "size": 500
              },
              "type": "raw_document"
            }
          ],
          "query": "request.headers.host:$host and status:$status",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "title": "$domain status:$status",
      "transform": "json",
      "transparent": true,
      "type": "table"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 18,
  "style": "dark",
  "tags": [
    "logstash",
    "kong",
    "elasticsearch"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "tags": [],
          "text": "testapp.eyingchina.com",
          "value": [
            "testapp.eyingchina.com"
          ]
        },
        "hide": 0,
        "includeAll": true,
        "label": "域名",
        "multi": true,
        "name": "domain",
        "options": [
          {
            "selected": false,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "testemc.eyingchina.com",
            "value": "testemc.eyingchina.com"
          },
          {
            "selected": false,
            "text": "testpmc.eyingchina.com",
            "value": "testpmc.eyingchina.com"
          },
          {
            "selected": true,
            "text": "testapp.eyingchina.com",
            "value": "testapp.eyingchina.com"
          }
        ],
        "query": "testemc.eyingchina.com,testpmc.eyingchina.com,testapp.eyingchina.com",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_KONG_HTTP LOG}",
        "definition": "{\"find\":\"terms\",\"field\":\"response.status\"}",
        "hide": 0,
        "includeAll": true,
        "label": "状态码",
        "multi": true,
        "name": "status",
        "options": [],
        "query": "{\"find\":\"terms\",\"field\":\"response.status\"}",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "auto": true,
        "auto_count": 100,
        "auto_min": "10s",
        "current": {
          "text": "auto",
          "value": "$__auto_interval_inter"
        },
        "datasource": null,
        "hide": 0,
        "includeAll": false,
        "label": "周期",
        "multi": false,
        "name": "inter",
        "options": [
          {
            "selected": true,
            "text": "auto",
            "value": "$__auto_interval_inter"
          },
          {
            "selected": false,
            "text": "1s",
            "value": "1s"
          },
          {
            "selected": false,
            "text": "5s",
            "value": "5s"
          },
          {
            "selected": false,
            "text": "10s",
            "value": "10s"
          },
          {
            "selected": false,
            "text": "30s",
            "value": "30s"
          },
          {
            "selected": false,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "10m",
            "value": "10m"
          },
          {
            "selected": false,
            "text": "30m",
            "value": "30m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "6h",
            "value": "6h"
          },
          {
            "selected": false,
            "text": "12h",
            "value": "12h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          },
          {
            "selected": false,
            "text": "7d",
            "value": "7d"
          },
          {
            "selected": false,
            "text": "14d",
            "value": "14d"
          },
          {
            "selected": false,
            "text": "30d",
            "value": "30d"
          }
        ],
        "query": "1s,5s,10s,30s,1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      }
    ]
  },
  "time": {
    "from": "now/d",
    "to": "now/d"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Kong http Logs",
  "uid": "4Uf2RVgZz",
  "version": 1
}