Query Details

Track The Usage Of Specific Applications And How Often They Are Started

Query

// Use Case: Monitoring and identifying the most frequently executed processes on a system for a given day.
Process
| where isnotnull(ProcessName) and isnotnull(StartDateTime) // Ensure fields are not null
| summarize Count = count() by ProcessName, bin(StartDateTime, 1d) // Aggregate counts by day and ProcessName
| order by Count desc
| project ProcessName, Count

Explanation

This query is designed to monitor and identify the most frequently executed processes on a system for a specific day. Here's a simple breakdown of what it does:

  1. Filter Data: It starts by filtering out any records where the ProcessName or StartDateTime fields are missing, ensuring that only complete data is analyzed.

  2. Aggregate Data: It then groups the data by ProcessName and the day (StartDateTime is binned into 1-day intervals). For each group, it counts how many times each process was executed.

  3. Sort Data: The results are sorted in descending order based on the count, so the most frequently executed processes appear first.

  4. Select Output: Finally, it selects and displays only the ProcessName and the corresponding count of executions.

In summary, this query helps you see which processes were run the most on a given day, sorted from most to least frequent.

Details

Ugur Koc profile picture

Ugur Koc

Released: December 13, 2024

Tables

Process

Keywords

Process

Operators

whereisnotnullandsummarizecountbybinorder bydescproject

Actions

GitHub