Query Details

Summary Rules - Unique Actions

Unique Actions

Query

union * 
| extend Action = coalesce(Operation, OperationName, OperationNameValue, ActionType) 
| where isnotempty(Action) 
| summarize TotalEvents = count() by Type, Action
| extend RetrievalDate = StartDate
| sort by Type

About this query

Summary Rules - Unique Actions

Query Information

Description

This summary rule saves all unique actions and how often they appear in your environment to the custom table or your choice.

This allows for easy retrieval of statistics and trends on how many unique actions are found in the environment each day.

Recommended Schedule: 24 hours.

Recommended Delay: 60 minutes.

References

Sentinel

Explanation

This query is designed to collect and store information about unique actions occurring in your environment. Here's a simple breakdown of what it does:

  1. Combine Data: It gathers data from all available sources (indicated by union *).

  2. Identify Actions: It creates a new field called Action by selecting the first non-empty value from a list of possible fields (Operation, OperationName, OperationNameValue, ActionType). This helps in standardizing the action names.

  3. Filter Non-Empty Actions: It filters out any records where the Action field is empty, ensuring only meaningful actions are considered.

  4. Count Unique Actions: It counts how many times each unique action occurs, grouped by the type of event and the action itself.

  5. Add Retrieval Date: It adds a field called RetrievalDate to record when the data was collected.

  6. Sort Results: Finally, it sorts the results by the type of event.

The query is intended to run once every 24 hours with a 60-minute delay to ensure all data is collected. This setup helps in tracking statistics and trends of actions in your environment over time.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: October 20, 2024

Tables

*

Keywords

SummaryRulesUniqueActionsEnvironmentStatisticsTrendsRetrievalSentinel

Operators

unionextendcoalescewhereisnotemptysummarizecountbysort

Actions

GitHub