Skip to content

Commit be6059b

Browse files
committed
Added sample queries
1 parent d89ad94 commit be6059b

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

articles/sentinel/health-audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ To start collecting health and audit data, you need to [enable health and audit
6464
- Run queries on the *SentinelHealth* and *SentinelAudit* data tables from the Microsoft Sentinel **Logs** blade.
6565
- [Data connectors](monitor-data-connector-health.md#run-queries-to-detect-health-drifts)
6666
- [Automation rules and playbooks](monitor-automation-health.md#get-the-complete-automation-picture) (join query with Azure Logic Apps diagnostics)
67-
- [Analytics rules](monitor-analytics-rule-integrity.md)
67+
- [Analytics rules](monitor-analytics-rule-integrity.md#run-queries-to-detect-health-and-integrity-issues)
6868

6969
- Use the health monitoring workbooks provided in Microsoft Sentinel.
7070
- [Data connectors](monitor-data-connector-health.md#use-the-health-monitoring-workbook)

articles/sentinel/monitor-analytics-rule-integrity.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,80 @@ The following types of analytics rule audit events are logged in the *SentinelAu
5656

5757
For more information, see [SentinelAudit table columns schema](audit-table-reference.md#sentinelaudit-table-columns-schema).
5858

59+
### Run queries to detect health and integrity issues
60+
61+
For best results, you should build your queries on the **pre-built functions** on these tables, ***_SentinelHealth()*** and ***_SentinelAudit()***, instead of querying the tables directly. These functions ensure the maintenance of your queries' backward compatibility in the event of changes being made to the schema of the tables themselves.
62+
63+
As a first step, your queries should filter the tables for data related to analytics rules. Use the `SentinelResourceType` parameter.
64+
65+
```kusto
66+
_SentinelHealth()
67+
| where SentinelResourceType == "Analytics Rule"
68+
```
69+
70+
If you want, you can further filter the list for a particular kind of analytics rule. Use the `SentinelResourceKind` parameter for this.
71+
72+
```kusto
73+
| where SentinelResourceKind == "Scheduled"
74+
75+
# OR
76+
77+
| where SentinelResourceKind == "NRT"
78+
```
79+
80+
Here are some sample queries to help you get started:
81+
82+
- Find rules that didn't run successfully:
83+
84+
```kusto
85+
_SentinelHealth()
86+
| where SentinelResourceType == "Analytics Rule"
87+
| where Status != "Success"
88+
```
89+
90+
- Find rules that have been "[auto-disabled](detect-threats-custom.md#issue-a-scheduled-rule-failed-to-execute-or-appears-with-auto-disabled-added-to-the-name)":
91+
92+
```kusto
93+
_SentinelHealth()
94+
| where SentinelResourceType == "Analytics Rule"
95+
| where Reason == "The analytics rule is disabled and was not executed."
96+
```
97+
98+
- Count the rules and runnings that succeeded or failed, by reason:
99+
100+
```kusto
101+
_SentinelHealth()
102+
| where SentinelResourceType == "Analytics Rule"
103+
| summarize Occurrence=count(), Unique_rule=dcount(SentinelResourceId) by Status, Reason
104+
```
105+
106+
- Find rule deletion activity:
107+
108+
```kusto
109+
_SentinelAudit()
110+
| where SentinelResourceType =="Analytic Rule"
111+
| where Description =="Analytics rule deleted"
112+
```
113+
114+
- Find activity on rules, by rule name and activity name:
115+
116+
```kusto
117+
_SentinelAudit()
118+
| where SentinelResourceType =="Analytic Rule"
119+
| summarize Count= count() by RuleName=SentinelResourceName, Activity=Description
120+
```
121+
122+
- Find activity on rules, by caller name (the identity that performed the activity):
123+
124+
```kusto
125+
_SentinelAudit()
126+
| where SentinelResourceType =="Analytic Rule"
127+
| extend Caller= tostring(ExtendedProperties.CallerName)
128+
| summarize Count = count() by Caller, Activity=Description
129+
```
130+
131+
132+
59133
### Statuses, errors and suggested steps
60134
61135
For either **Scheduled analytics rule run** or **NRT analytics rule run**, you may see any of the following statuses and descriptions:

0 commit comments

Comments
 (0)