Grafana dashboard: PeekabooAV drill down - Detailed Job Info
Description: Allows to drill down into Peekaboo and Cuckoo Sandbox db to look for amavis job id


{
  "__inputs": [
    {
      "name": "DS_PEEKABOO",
      "label": "peekaboo",
      "description": "Peekaboo database backend",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    },
    {
      "name": "VAR_JOB_HASH",
      "type": "constant",
      "label": "job_hash",
      "value": "amavis-20180528T143327-26679-1ek0vVL0",
      "description": "amavis job hash to look for"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.1.3"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "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)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 6309,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1527519506733,
  "links": [],
  "panels": [
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PEEKABOO}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "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": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "amavis-20180528T143327-26679-1ek0vVL0",
      "targets": [
        {
          "alias": "",
          "format": "table",
          "rawSql": "SELECT \"$job_hash\"",
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "Analysed Job",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "columns": [],
      "datasource": "${DS_PEEKABOO}",
      "fontSize": "100%",
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 3
      },
      "id": 3,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 5,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "MM/DD/YY h:mm:ss a",
          "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)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "pattern": "sample_id",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "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": 0,
          "pattern": "id",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "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": 0,
          "pattern": "Incomes",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": "cell",
          "colors": [
            "#052b51",
            "#0a437c",
            "#58140c"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Cuckoo Smmary",
          "linkUrl": "http://localhost:8000/analysis/$__cell/summary",
          "pattern": "Cuckoo ID",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "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": [
        {
          "alias": "",
          "format": "table",
          "rawSql": "SELECT distinct job.id AS 'ID', job.filename AS 'Filename', job.cuckoo_job_id AS 'Cuckoo ID', info.file_extension AS 'File extension', result.name AS 'Result', job.analyses_time AS 'Analyses time', job.sample_id AS 'Sample ID', Incomes.value AS 'Incomes'\n from\n (SELECT COUNT(*) AS value, job.sample_id\n FROM analysis_jobs_v3 job, sample_info_v3 info\n WHERE job.sample_id=info.id\nGROUP BY job.sample_id\n) AS Incomes,\n analysis_jobs_v3 AS job, analysis_result_v3 AS result, sample_info_v3 as info \n WHERE ( job.sample_id=info.id AND info.result_id=result.id AND job.job_hash = \"$job_hash\" AND Incomes.sample_id=job.sample_id )\n",
          "refId": "A"
        }
      ],
      "title": "Analysed Files",
      "transform": "table",
      "type": "table"
    }
  ],
  "refresh": false,
  "schemaVersion": 16,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "value": "${VAR_JOB_HASH}",
          "text": "${VAR_JOB_HASH}"
        },
        "hide": 2,
        "label": null,
        "name": "job_hash",
        "options": [
          {
            "value": "${VAR_JOB_HASH}",
            "text": "${VAR_JOB_HASH}"
          }
        ],
        "query": "${VAR_JOB_HASH}",
        "type": "constant"
      }
    ]
  },
  "time": {
    "from": "2018-05-04T11:54:15.319Z",
    "to": "2018-05-12T11:54:15.319Z"
  },
  "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": "",
  "title": "PeekabooAV drill down - Detailed Job Info",
  "uid": "5wlWZE4iz",
  "version": 2,
  "description": "Allows to drill down into Peekaboo and Cuckoo Sandbox db to look for amavis job id"
}