Query Details

Visualize FileTypes based on DeviceFileEvents

Visualization File Types

Query

let TimeFrame = 7d;
DeviceFileEvents
| where Timestamp > ago(TimeFrame)
| extend FileType = tostring(parse_json(AdditionalFields).FileType)
| where isnotempty(FileType)
| summarize Total = count() by FileType
| render piechart with(title="FileTypes used")

About this query

Visualize FileTypes based on DeviceFileEvents

Defender XDR

Sentinel

let TimeFrame = 7d;
DeviceFileEvents
| where Timestamp > ago(TimeFrame)
| extend FileType = tostring(parse_json(AdditionalFields).FileType)
| where isnotempty(FileType)
| summarize Total = count() by FileType
| render piechart with(title="FileTypes used")

Explanation

This query is designed to visualize the types of files that have been involved in device file events over the past 7 days. Here's a simple breakdown of what it does:

  1. Time Frame: It looks at data from the last 7 days.

  2. Data Source: It uses the DeviceFileEvents table, which contains records of file-related events on devices.

  3. Extract File Type: It extracts the FileType information from the AdditionalFields column, which is stored in JSON format.

  4. Filter Non-Empty File Types: It filters out any records where the FileType is not specified or empty.

  5. Count File Types: It counts how many times each file type appears in the data.

  6. Visualize: It creates a pie chart to display the distribution of different file types used, with the title "FileTypes used".

This query is used in both Defender XDR and Sentinel to provide a visual representation of file type usage based on recent device file events.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: December 1, 2024

Tables

DeviceFileEvents

Keywords

DeviceFileEventsTimestampAdditionalFieldsTypeTotalPiechartTitle

Operators

letwhereagoextendtostringparse_jsonisnotemptysummarizecountbyrenderwith

Actions

GitHub