{
  "version": "Notebook/1.0",
  "items": [
    {
      "type": 1,
      "content": {
        "json": "**NOTE**: This workbook depends on a parser based on Kusto Function **ZNSegmentAudit** to work as expected. [Follow steps to get this Kusto Function](https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/ZeroNetworks/Parsers/ZNSegmentAudit.yaml)"
      },
      "name": "text - 8"
    },
    {
      "type": 9,
      "content": {
        "version": "KqlParameterItem/1.0",
        "parameters": [
          {
            "id": "cd8447d9-b096-4673-92d8-2a1e8291a125",
            "version": "KqlParameterItem/1.0",
            "name": "TimeRange",
            "type": 4,
            "description": "Sets the time name for analysis",
            "value": {
              "durationMs": 604800000
            },
            "typeSettings": {
              "selectableValues": [
                {
                  "durationMs": 900000
                },
                {
                  "durationMs": 3600000
                },
                {
                  "durationMs": 86400000
                },
                {
                  "durationMs": 604800000
                },
                {
                  "durationMs": 2592000000
                },
                {
                  "durationMs": 7776000000
                }
              ]
            },
            "timeContext": {
              "durationMs": 86400000
            }
          }
        ],
        "style": "pills",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces"
      },
      "name": "parameters - 11"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| make-series TotalEvents = count() default = 0 on TimeGenerated from {TimeRange:start} to {TimeRange:end} step {TimeRange:grain};",
        "size": 0,
        "title": "Audit Events Over Time",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "timechart",
        "graphSettings": {
          "type": 0
        }
      },
      "customWidth": "55",
      "name": "query - 12",
      "styleSettings": {
        "maxWidth": "55"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| where isnotempty(Platform) \r\n| summarize count() by Platform\r\n| join kind = inner (ZNSegmentAudit \r\n                    | make-series Trend = count() default = 0 on TimeGenerated from {TimeRange:start} to {TimeRange:end} step {TimeRange:grain} by Platform) on Platform\r\n| project-away Platform1, TimeGenerated\r\n| project count_, Platform, Trend\r\n",
        "size": 3,
        "title": "Platform",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "tiles",
        "tileSettings": {
          "titleContent": {
            "columnMatch": "Platform",
            "formatter": 1
          },
          "leftContent": {
            "columnMatch": "count_",
            "formatter": 12,
            "formatOptions": {
              "palette": "auto"
            },
            "numberFormat": {
              "unit": 17,
              "options": {
                "style": "decimal",
                "maximumFractionDigits": 2,
                "maximumSignificantDigits": 3
              }
            }
          },
          "secondaryContent": {
            "columnMatch": "Trend",
            "formatter": 21,
            "formatOptions": {
              "palette": "blue"
            }
          },
          "showBorder": false
        }
      },
      "customWidth": "30",
      "name": "query - 0",
      "styleSettings": {
        "maxWidth": "30"
      }
    },
    {
      "type": 12,
      "content": {
        "version": "NotebookGroup/1.0",
        "groupType": "editable",
        "items": [
          {
            "type": 3,
            "content": {
              "version": "KqlItem/1.0",
              "query": "ZNSegmentAudit\r\n| summarize dcount(Platform)",
              "size": 3,
              "title": "Platforms",
              "queryType": 0,
              "resourceType": "microsoft.operationalinsights/workspaces",
              "visualization": "card",
              "tileSettings": {
                "showBorder": false
              },
              "graphSettings": {
                "type": 0
              },
              "mapSettings": {
                "locInfo": "LatLong",
                "sizeSettings": "DstPortNumber",
                "sizeAggregation": "Sum",
                "legendMetric": "DstPortNumber",
                "legendAggregation": "Sum",
                "itemColorSettings": {
                  "type": "heatmap",
                  "colorAggregation": "Sum",
                  "nodeColorField": "DstPortNumber",
                  "heatmapPalette": "greenRed"
                }
              },
              "textSettings": {
                "style": "bignumber"
              }
            },
            "name": "query - 14"
          },
          {
            "type": 3,
            "content": {
              "version": "KqlItem/1.0",
              "query": "ZNSegmentAudit\r\n| summarize dcount(tostring(AffectedEntity.Name))\r\n",
              "size": 3,
              "title": "Destination Entities",
              "timeContextFromParameter": "TimeRange",
              "queryType": 0,
              "resourceType": "microsoft.operationalinsights/workspaces",
              "visualization": "card",
              "textSettings": {
                "style": "bignumber"
              }
            },
            "name": "query - 12"
          },
          {
            "type": 3,
            "content": {
              "version": "KqlItem/1.0",
              "query": "ZNSegmentAudit\n| extend PerformedByName = tostring(InitiatedBy.Name)\n| where isnotempty(PerformedByName)\n| summarize dcount(PerformedByName)",
              "size": 3,
              "title": "Users",
              "timeContextFromParameter": "TimeRange",
              "queryType": 0,
              "resourceType": "microsoft.operationalinsights/workspaces",
              "visualization": "card",
              "textSettings": {
                "style": "bignumber"
              }
            },
            "name": "query - 2"
          },
          {
            "type": 3,
            "content": {
              "version": "KqlItem/1.0",
              "query": "ZNSegmentAudit\n| count",
              "size": 3,
              "title": "Operations",
              "timeContextFromParameter": "TimeRange",
              "queryType": 0,
              "resourceType": "microsoft.operationalinsights/workspaces",
              "visualization": "card",
              "textSettings": {
                "style": "bignumber"
              }
            },
            "name": "query - 3"
          }
        ]
      },
      "customWidth": "15",
      "name": "group - 13"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| where isnotempty(AuditType) \r\n| summarize count() by AuditType\r\n| top 3 by count_",
        "size": 3,
        "title": "Top 3 Audit Types",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "piechart",
        "tileSettings": {
          "showBorder": false,
          "titleContent": {
            "columnMatch": "EventMessage",
            "formatter": 1
          },
          "leftContent": {
            "columnMatch": "count_",
            "formatter": 12,
            "formatOptions": {
              "palette": "auto"
            },
            "numberFormat": {
              "unit": 17,
              "options": {
                "maximumSignificantDigits": 3,
                "maximumFractionDigits": 2
              }
            }
          }
        }
      },
      "customWidth": "27",
      "name": "query - 3",
      "styleSettings": {
        "margin": "10",
        "padding": "10"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "  ZNSegmentAudit\r\n  | extend PerformedByName = tostring(InitiatedBy.Name)\r\n  | where isnotempty(PerformedByName) and PerformedByName != \"Zero Networks\"\r\n  | summarize count() by PerformedByName\r\n  | top 3 by count_\r\n",
        "size": 3,
        "title": "Top 3 Users",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "piechart"
      },
      "customWidth": "27",
      "name": "query - 9"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| extend PerformedByName = tostring(InitiatedBy.Name)\r\n| where isnotempty(PerformedByName) and PerformedByName != \"Zero Networks\"\r\n| summarize count() by PerformedByName, AuditType\r\n| project PerformedByName, AuditType, EventCount=count_\r\n| sort by EventCount desc \r\n",
        "size": 0,
        "title": "User activity",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "table"
      },
      "customWidth": "46",
      "name": "query - 15",
      "styleSettings": {
        "maxWidth": "30"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| extend PerformedByName = tostring(InitiatedBy.Name),\r\n    DestinationEntityName = tostring(AffectedEntity.Name)\r\n| where isnotempty(PerformedByName) and PerformedByName != \"Zero Networks\"\r\n| where isnotempty(DestinationEntityName) \r\n| summarize DestinationEntities = makeset(DestinationEntityName) by PerformedByName\r\n",
        "size": 0,
        "title": "Destination Entities by User",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "table"
      },
      "customWidth": "35",
      "name": "query - 10",
      "styleSettings": {
        "maxWidth": "30"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| summarize count() by Platform",
        "size": 0,
        "title": "Platforms",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "barchart"
      },
      "customWidth": "55",
      "name": "query - 13",
      "styleSettings": {
        "maxWidth": "50"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| summarize count() by AuditType\r\n",
        "size": 3,
        "title": "Audit Types",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "piechart",
        "gridSettings": {
          "rowLimit": 100,
          "filter": true
        }
      },
      "customWidth": "30",
      "name": "query - 12"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\n| extend PerformedByName = tostring(InitiatedBy.Name)\n| where isnotempty(PerformedByName) and PerformedByName != \"Zero Networks\"\n| summarize count() by PerformedByName",
        "size": 3,
        "title": "Users' Activity",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "piechart"
      },
      "customWidth": "30",
      "name": "query - 11"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\n| extend PerformedByName = tostring(InitiatedBy.Name)\n| where isnotempty(PerformedByName) and PerformedByName != \"Zero Networks\"\n| summarize count() by PerformedByName\n| order by count_\n| project PerformedByName, EventCount=count_",
        "size": 0,
        "title": "Events by user",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "table"
      },
      "customWidth": "40",
      "name": "query - 12"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| make-series Rule=countif(isnotnull(Rule)),  ReactivePolicy=countif(isnotnull(ReactivePolicy))default = 0 on TimeGenerated from {TimeRange:start} to {TimeRange:end} step {TimeRange:grain};\r\n",
        "size": 0,
        "title": "Rules vs Reactive Policies over Time",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "linechart"
      },
      "customWidth": "50",
      "name": "query - 13",
      "styleSettings": {
        "maxWidth": "60"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZNSegmentAudit\r\n| extend  Type=iif(isnotnull(Rule), \"Rule\", iff(isnotnull(ReactivePolicy), \"ReactivePolicy\", \"Other\"))\r\n| summarize count() by Type",
        "size": 3,
        "title": "Cont of Rules vs Reactive Policies",
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "piechart"
      },
      "customWidth": "50",
      "name": "query - 14",
      "styleSettings": {
        "maxWidth": "40"
      }
    }
  ],
  "fromTemplateId": "sentinel-ZNSegmentAudit",
  "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}