{
  "version": "7",
  "defaultTimeframe": {
    "from": "now()-7d",
    "to": "now()"
  },
  "defaultSegments": [],
  "sections": [
    {
      "id": "c6bf1417-7afa-49e9-b17e-dda465756d01",
      "type": "markdown",
      "markdown": "# Log Queries"
    },
    {
      "id": "4eac0c72-c3ea-4831-af92-def10ffb8429",
      "type": "dql",
      "title": "Broad Catch-all Token Ingest Data",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 117,
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch logs\n// Filter for any and all existing ingest tokens for a given timeframe\n| filterOut isNull(dt.auth.origin)"
        },
        "visualizationSettings": {
          "table": {
            "columnTypeOverrides": [
              {
                "fields": [
                  "content"
                ],
                "id": 1771817216685,
                "value": "log-content",
                "disableRemoval": true
              }
            ],
            "hideColumnsForLargeResults": true
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    },
    {
      "id": "85894d50-75a7-40f2-be92-e1966b544fd3",
      "type": "dql",
      "title": "Search for Ingestion Activity with a Given Token",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 130,
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch logs\n// Filter for a specific token\n| filter dt.auth.origin == \"<public part of your token>\"\n// Fields to be displayed\n| fields timestamp,\n         dt.auth.origin,\n         content\n// Sort by timestamp\n| sort timestamp desc"
        },
        "visualizationSettings": {
          "table": {
            "columnTypeOverrides": [
              {
                "fields": [
                  "content"
                ],
                "id": 1771721190447,
                "value": "log-content",
                "disableRemoval": true
              }
            ],
            "hideColumnsForLargeResults": true,
            "sortBy": [
              {
                "columnId": "[\"content\"]",
                "direction": "ascending"
              }
            ]
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    },
    {
      "id": "7c362392-3756-4bdf-be37-b940f9b42726",
      "type": "dql",
      "title": "First and Last Seen Ingestion Activity for a Given Token",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 84,
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch logs\n// Filter for a specific token\n| filter dt.auth.origin == \"<public part of your token>\"\n// Data aggregate first and last seen activity\n| summarize firstSeen=min(timestamp), lastSeen=max(timestamp), count()"
        },
        "visualizationSettings": {
          "table": {
            "hideColumnsForLargeResults": true
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    },
    {
      "id": "f95eeef7-74be-4b2f-a7e7-70781f90a3af",
      "type": "dql",
      "title": "Burst Ingest Detection (Identify Surges in 5-Minute Intervals)",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 89,
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch logs\n// Filter for a specific token\n| filter dt.auth.origin == \"<public part of your token>\"\n// Data aggregate a count of ingestion activity by 5-minute intervals\n| summarize count(), by: {bin(timestamp, 5m)}\n"
        },
        "visualizationSettings": {
          "table": {
            "hideColumnsForLargeResults": true
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    },
    {
      "id": "e54866bf-6657-407e-8643-f9054872aad5",
      "type": "markdown",
      "markdown": "# Audit Event Queries"
    },
    {
      "id": "615fdcce-dc79-44be-875d-32813a7036f7",
      "type": "dql",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 106,
      "title": "Search All Audit Events for a Given Token",
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch dt.system.events\n// Narrow scope to audit events only\n| filter event.kind == \"AUDIT_EVENT\"\n// Filter down to view only the desired token\n| filter authentication.token == \"<public part of your token>\"\n// Sort by timestamp\n| sort timestamp desc"
        },
        "visualizationSettings": {
          "table": {
            "hideColumnsForLargeResults": true,
            "columnWidths": {
              "[\"event.id\"]": 289.89
            }
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    },
    {
      "id": "38c173b6-48a3-40f6-aa9e-5673abaa0e6b",
      "type": "dql",
      "title": "IP Addresses Seen for a Given Token",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 59,
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch dt.system.events\n// Narrow scope to audit events only\n| filter event.kind == \"AUDIT_EVENT\"\n// Filter down to view only the desired token\n| filter authentication.token == \"<public part of your token>\"\n// Filter for entries with a resolved IP address\n| filter isNotNull(origin.address)\n// Data aggregation by IP address\n| summarize {count(), firstSeen=min(timestamp), lastSeen=max(timestamp)}, by: {origin.address}"
        },
        "visualizationSettings": {
          "table": {
            "hideColumnsForLargeResults": true
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    },
    {
      "id": "bcf7e4b4-6cd3-4521-8b27-8cf0f301c7e8",
      "type": "dql",
      "title": "Resources Interacted with Count by a Given Token",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 77,
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch dt.system.events\n// Narrow scope to audit events only\n| filter event.kind == \"AUDIT_EVENT\"\n// Filter down to view only the desired token\n| filter authentication.token == \"<public part of your token>\"\n// Data aggregation count by resource\n| summarize count(), by: {resource}"
        },
        "visualizationSettings": {
          "table": {
            "hideColumnsForLargeResults": true
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    },
    {
      "id": "ff03b1b8-cfe8-4f60-9c0f-128400719e33",
      "type": "dql",
      "title": "What User Performed What Action When",
      "showTitle": false,
      "drilldownPath": [],
      "filterSegments": [],
      "previousFilterSegments": [],
      "height": 158,
      "state": {
        "input": {
          "timeframe": {
            "from": "now()-7d",
            "to": "now()"
          },
          "value": "fetch dt.system.events\n// Narrow scope to audit events only\n| filter event.kind == \"AUDIT_EVENT\"\n// Filter down to view only the desired token\n| filter authentication.token == \"<public part of your token>\"\n// Define Fields\n| fields user.id, type, timestamp, event.type\n// Aggregate information by event type\n| summarize {count(), firstSeen = min(timestamp), lastSeen = max(timestamp), collectDistinct(user.id)}, by: {event.type}\n// Sort by last seen\n| sort lastSeen desc"
        },
        "visualizationSettings": {
          "table": {
            "hideColumnsForLargeResults": true
          },
          "autoSelectVisualization": true,
          "chartSettings": {}
        },
        "querySettings": {
          "maxResultRecords": 1000,
          "defaultScanLimitGbytes": 500,
          "maxResultMegaBytes": 1,
          "defaultSamplingRatio": 10,
          "enableSampling": false
        },
        "visualization": "table"
      }
    }
  ]
}