Grafana dashboard: Nginx analysis
Description: Dashboard for Nginx used with Graylog log collector. 

Dashboard for Nginx used with Graylog log collector. 

Content pack for Graylog: https://github.com/6bIBAET/graylog-nginx-for-grafana

How-to on Russian: https://itcrowd.top/graylog-nginx-grafana

{
  "__inputs": [
    {
      "name": "DS_GRAYLOG_ELASTICSEARCH",
      "label": "Graylog Elasticsearch",
      "description": "Graylog Elasticsearch Database",
      "type": "datasource",
      "pluginId": "elasticsearch",
      "pluginName": "Elasticsearch"
    }
  ],
  "__requires": [
    {
      "type": "datasource",
      "id": "elasticsearch",
      "name": "Elasticsearch",
      "version": "5.0.0"
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.2.1"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.3.3"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "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)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 8486,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1540096980612,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
      "fill": 1,
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 9,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "nginx_domain_name",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "nginx_domain_name:$URIAddr",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [],
          "timeField": "timestamp"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Number of hits graph",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
      "fontSize": "100%",
      "gridPos": {
        "h": 12,
        "w": 6,
        "x": 12,
        "y": 0
      },
      "id": 3,
      "links": [],
      "pageSize": 10,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 1,
        "desc": true
      },
      "styles": [
        {
          "alias": "Number of requests",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "link": false,
          "pattern": "Count",
          "type": "number",
          "unit": "none"
        },
        {
          "alias": "Address",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "remote_addr",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Domain name",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "nginx_domain_name",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "nginx_domain_name",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            }
          ],
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "nginx_domain_name:$URIAddr AND  remote_addr:$Remoteaddr",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [],
          "timeField": "timestamp"
        }
      ],
      "title": "Number of requests per domain name",
      "transform": "table",
      "type": "table"
    },
    {
      "columns": [],
      "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
      "fontSize": "100%",
      "gridPos": {
        "h": 12,
        "w": 6,
        "x": 18,
        "y": 0
      },
      "id": 2,
      "links": [],
      "pageSize": 10,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 2,
        "desc": true
      },
      "styles": [
        {
          "alias": "Count",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "link": false,
          "pattern": "Count",
          "type": "number",
          "unit": "none"
        },
        {
          "alias": "Address",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "remote_addr",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Domain name",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "nginx_domain_name",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "remote_addr",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "nginx_domain_name",
              "id": "2",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            }
          ],
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "remote_addr:$Remoteaddr AND nginx_domain_name:$URIAddr",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [],
          "timeField": "timestamp"
        }
      ],
      "title": "Number of hits from the IP-address",
      "transform": "table",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
      "fill": 1,
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 0,
        "y": 12
      },
      "id": 11,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "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": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "hide": false,
          "metrics": [
            {
              "field": "select metric",
              "id": "1",
              "meta": {},
              "pipelineAgg": "select metric",
              "settings": {},
              "type": "count"
            }
          ],
          "query": "response_status:$ResponseStatus",
          "refId": "A",
          "timeField": "timestamp"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Response Codes Chart",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "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": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
      "fontSize": "100%",
      "gridPos": {
        "h": 12,
        "w": 6,
        "x": 12,
        "y": 12
      },
      "id": 6,
      "links": [],
      "pageSize": 10,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 2,
        "desc": true
      },
      "styles": [
        {
          "alias": "Count",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "link": false,
          "mappingType": 1,
          "pattern": "Count",
          "preserveFormat": false,
          "sanitize": false,
          "type": "number",
          "unit": "none",
          "valueMaps": [
            {
              "text": "304 Not Modified",
              "value": "304"
            }
          ]
        },
        {
          "alias": "Address",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "remote_addr",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Response code",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": null,
          "mappingType": 1,
          "pattern": "response_status",
          "thresholds": [],
          "type": "string",
          "unit": "short",
          "valueMaps": [
            {
              "text": "200 OK",
              "value": "200"
            },
            {
              "text": "206 Partial Content",
              "value": "206"
            },
            {
              "text": "301 Moved Permanently",
              "value": "301"
            },
            {
              "text": "302 Moved Temporarily",
              "value": "302"
            },
            {
              "text": "304 Not Modified",
              "value": "304"
            },
            {
              "text": "400 Bad Request",
              "value": "400"
            },
            {
              "text": "401 Unauthorized",
              "value": "401"
            },
            {
              "text": "403 Forbidden",
              "value": "403"
            },
            {
              "text": "404 Not Found",
              "value": "404"
            },
            {
              "text": "499 Client Closed Request",
              "value": "499"
            },
            {
              "text": "440 Login Time-out",
              "value": "440"
            },
            {
              "text": "504 Gateway Timeout",
              "value": "504"
            }
          ]
        }
      ],
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "remote_addr",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "response_status",
              "id": "2",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            }
          ],
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "remote_addr:$Remoteaddr AND response_status:$ResponseStatus",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [],
          "timeField": "timestamp"
        }
      ],
      "title": "Response codes to address",
      "transform": "table",
      "type": "table"
    },
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 12,
        "w": 6,
        "x": 18,
        "y": 12
      },
      "id": 5,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "response_status",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "response_status:$ResponseStatus",
          "refId": "A",
          "timeField": "timestamp"
        }
      ],
      "title": "Response code count",
      "transparent": false,
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {},
      "breakPoint": "75%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 19,
        "w": 12,
        "x": 0,
        "y": 24
      },
      "hideTimeOverride": false,
      "id": 7,
      "interval": null,
      "legend": {
        "percentage": true,
        "show": true,
        "sideWidth": 0,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "pieType": "pie",
      "strokeWidth": "",
      "targets": [
        {
          "bucketAggs": [
            {
              "fake": true,
              "field": "user_browser",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "use",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "query": "user_browser:*",
          "refId": "A",
          "timeField": "timestamp"
        }
      ],
      "timeFrom": null,
      "title": "Browser",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    }
  ],
  "refresh": false,
  "schemaVersion": 16,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
        "hide": 0,
        "includeAll": true,
        "label": "Remote IP-address",
        "multi": true,
        "name": "Remoteaddr",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\":\"remote_addr\",\"size\": \"1000000\" }",
        "refresh": 2,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
        "hide": 0,
        "includeAll": true,
        "label": "Nginx domain name",
        "multi": true,
        "name": "URIAddr",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\":\"nginx_domain_name\",\"size\": \"1000000\" }",
        "refresh": 2,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_GRAYLOG_ELASTICSEARCH}",
        "hide": 0,
        "includeAll": true,
        "label": "Response code",
        "multi": true,
        "name": "ResponseStatus",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\":\"response_status\",\"size\": \"1000000\" }",
        "refresh": 2,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "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": "Nginx analysis",
  "uid": "eluMiZbmz",
  "version": 56,
  "description": "Dashboard for Nginx used with Graylog log collector. "
}