{
  "__inputs": [
    {
      "name": "DS_MEDIAHARBORDB",
      "label": "MediaHarborDB",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "11.0.0"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "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": false,
  "panels": [
    {
      "datasource": {
        "type": "mysql",
        "uid": "${DS_MEDIAHARBORDB}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "right",
            "cellOptions": {
              "mode": "gradient",
              "type": "color-background"
            },
            "filterable": false,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "transparent",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "jsondata"
            },
            "properties": [
              {
                "id": "custom.hidden",
                "value": true
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "break_duration.duration"
            },
            "properties": [
              {
                "id": "custom.hidden",
                "value": true
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Description"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "0": {
                        "color": "transparent",
                        "index": 1,
                        "text": "Return"
                      },
                      "1": {
                        "color": "green",
                        "index": 0,
                        "text": "Splice Now"
                      }
                    },
                    "type": "value"
                  }
                ]
              },
              {
                "id": "custom.width",
                "value": 111
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 21,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "enablePagination": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Date"
          }
        ]
      },
      "pluginVersion": "11.0.0",
      "targets": [
        {
          "dataset": "mediaharbor",
          "datasource": {
            "type": "mysql",
            "uid": "${DS_MEDIAHARBORDB}"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT date as Date, jsondata, mediaharbor.sources.name as Name FROM mediaharbor.monlogs\r\n INNER JOIN mediaharbor.sources ON mediaharbor.monlogs.source_id = mediaharbor.sources.id\r\n WHERE log_id = '00300100' order by Date desc LIMIT 50",
          "refId": "SCTE35",
          "sql": {
            "columns": [
              {
                "parameters": [
                  {
                    "name": "date",
                    "type": "functionParameter"
                  }
                ],
                "type": "function"
              },
              {
                "parameters": [
                  {
                    "name": "jsondata",
                    "type": "functionParameter"
                  }
                ],
                "type": "function"
              },
              {
                "parameters": [
                  {
                    "name": "source_id",
                    "type": "functionParameter"
                  }
                ],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50,
            "whereJsonTree": {
              "children1": [
                {
                  "id": "a8b989ab-4567-489a-bcde-f18fa9a05006",
                  "properties": {
                    "field": "log_id",
                    "fieldSrc": "field",
                    "operator": "equal",
                    "value": [
                      "00300100"
                    ],
                    "valueSrc": [
                      "value"
                    ],
                    "valueType": [
                      "text"
                    ]
                  },
                  "type": "rule"
                }
              ],
              "id": "8a9989aa-0123-4456-b89a-b18fa99f8c20",
              "type": "group"
            },
            "whereString": "log_id = '00300100'"
          },
          "table": "monlogs"
        }
      ],
      "title": "SCTE35 splice_insert",
      "transformations": [
        {
          "id": "extractFields",
          "options": {
            "format": "json",
            "jsonPaths": [
              {
                "alias": "Description",
                "path": "table.splice_info_section.splice_command.splice_insert.out_of_network_indicator"
              },
              {
                "alias": "Program ID",
                "path": "table.splice_info_section.splice_command.splice_insert.unique_program_id"
              },
              {
                "alias": "Event ID",
                "path": "table.splice_info_section.splice_command.splice_insert.splice_event_id"
              },
              {
                "alias": "break_duration.duration",
                "path": "table.splice_info_section.splice_command.splice_insert.break_duration.duration"
              }
            ],
            "keepTime": false,
            "replace": false,
            "source": "jsondata"
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "Duration(sec)",
            "binary": {
              "left": "break_duration.duration",
              "operator": "/",
              "right": "90000"
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            }
          }
        },
        {
          "id": "filterByValue",
          "options": {
            "filters": [
              {
                "config": {
                  "id": "notEqual",
                  "options": {
                    "value": "Not Found"
                  }
                },
                "fieldName": "Description"
              }
            ],
            "match": "all",
            "type": "include"
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "auto",
  "schemaVersion": 39,
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timeRangeUpdatedDuringEditOrView": false,
  "timepicker": {},
  "timezone": "",
  "title": "SCTE35 splice_insert",
  "uid": "b554a257-cb43-45ae-87d4-73640e14e409",
  "version": 1,
  "weekStart": ""
}