-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathabandon-journeys.json
251 lines (251 loc) · 8.85 KB
/
abandon-journeys.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
{
"version": "Notebook/1.0",
"items": [
{
"type": 1,
"content": {
"json": "## List of Abandon Journeys\n---------------------------\n### Select the CorrelationId to view details about the journey."
},
"name": "text - 2"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"parameters": [
{
"id": "55f2a818-f152-4dd1-9d59-c363aac9072e",
"version": "KqlParameterItem/1.0",
"name": "TimeRange",
"label": "Time Range",
"type": 4,
"isRequired": true,
"typeSettings": {
"selectableValues": [
{
"durationMs": 300000
},
{
"durationMs": 900000
},
{
"durationMs": 1800000
},
{
"durationMs": 3600000
},
{
"durationMs": 14400000
},
{
"durationMs": 43200000
},
{
"durationMs": 86400000
},
{
"durationMs": 172800000
},
{
"durationMs": 259200000
},
{
"durationMs": 604800000
},
{
"durationMs": 1209600000
},
{
"durationMs": 2419200000
},
{
"durationMs": 2592000000
},
{
"durationMs": 5184000000
},
{
"durationMs": 7776000000
}
],
"allowCustom": true
},
"timeContext": {
"durationMs": 86400000
}
},
{
"id": "cf9c0808-2ca8-4c82-9254-74cc250c3267",
"version": "KqlParameterItem/1.0",
"name": "AppInsightsId",
"label": "Application Insights Identifier",
"type": 1,
"description": "Identifies the app using one of the formats described in the document: https://docs.microsoft.com/en-us/azure/azure-monitor/logs/app-expression#arguments",
"isRequired": true,
"value": "",
"timeContext": {
"durationMs": 86400000
}
},
{
"id": "6180349e-8221-4446-8af8-09dac9962c57",
"version": "KqlParameterItem/1.0",
"name": "Policy",
"label": "Azure AD B2C Policy",
"type": 1,
"description": "Azure AD B2C Policy (e.g. B2C_1A_SUSI)",
"isRequired": true,
"value": ""
}
],
"style": "pills",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
},
"name": "parameters - 9"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "\n///////////////////////\n// Abandon Journeys\n///////////////////////\nlet policy_Id= '{Policy:value}'; \nlet journeyEmpty = (journeyName:string) { iif(journeyName == \"\", \"Journey Not Finished\",journeyName) };\nlet journeyCount = (journeyName:string) { journeyName };\nlet journey = (journeyName:string) { app(\"{AppInsightsId:value}\").customEvents \n | extend CorrelationId_ = tostring(parse_json(customDimensions).CorrelationId)\n | extend Policy_ = tostring(customDimensions.Policy)\n | where Policy_ == policy_Id\n | where name == journeyName\n | project CorrelationId_, Policy_, name, timestamp\n };\njourney(\"JourneyStarted\") \n| \n join kind=fullouter (journey(\"JourneyCompleted\") \n | project _policy_Id=policy_Id, _name=name, CorrelationId_ )\n on $left.CorrelationId_ == $right.CorrelationId_\n | where _name == \"\"\n | project Started=name,Finished=journeyEmpty(_name), timestamp, policy_Id, CorrelationId=CorrelationId_\n | take 250 //Default limit for workbook\n ",
"size": 4,
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "TimeRange",
"exportFieldName": "CorrelationId",
"exportParameterName": "CorrelationId",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"gridSettings": {
"formatters": [
{
"columnMatch": "Started",
"formatter": 18,
"formatOptions": {
"thresholdsOptions": "icons",
"thresholdsGrid": [
{
"operator": "==",
"thresholdValue": "JourneyStarted",
"representation": "success",
"text": "{0}{1}"
},
{
"operator": "Default",
"thresholdValue": null,
"representation": "success",
"text": "{0}{1}"
}
]
}
},
{
"columnMatch": "Finished",
"formatter": 18,
"formatOptions": {
"thresholdsOptions": "icons",
"thresholdsGrid": [
{
"operator": "==",
"thresholdValue": "Journey Not Finished",
"representation": "2",
"text": "{0}{1}"
},
{
"operator": "Default",
"thresholdValue": null,
"representation": "success",
"text": "{0}{1}"
}
]
}
}
]
}
},
"name": "query - 2"
},
{
"type": 1,
"content": {
"json": "### Journey Details\n-------------------"
},
"name": "text - 7"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "app(\"{AppInsightsId:value}\").customEvents \n | extend CorrelationId_ = tostring(parse_json(customDimensions).CorrelationId)\n | extend Policy_ = tostring(customDimensions.Policy)\n | where CorrelationId_ == '{CorrelationId}' \n | project CorrelationId_, Policy_, name, timestamp\n | order by timestamp desc",
"size": 4,
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "TimeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"gridSettings": {
"sortBy": [
{
"itemKey": "name",
"sortOrder": 1
}
]
},
"sortBy": [
{
"itemKey": "name",
"sortOrder": 1
}
]
},
"name": "query - 2"
},
{
"type": 1,
"content": {
"json": "### SignIn Logs\n-------------------"
},
"name": "text - 5"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "\nSigninLogs\n | where CorrelationId == '{CorrelationId}'\n | project TimeGenerated, UserPrincipalName, CorrelationId, ClientAppUsed, AppDisplayName, ResultDescription, ResultType, tostring( DeviceDetail), IPAddress\n | order by TimeGenerated desc\n\n",
"size": 1,
"timeContext": {
"durationMs": 5184000000
},
"timeContextFromParameter": "TimeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
},
"name": "query - 3"
},
{
"type": 1,
"content": {
"json": "### Audit Logs\n-------------------"
},
"name": "text - 6"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "\nAuditLogs\n | where CorrelationId == '{CorrelationId}'\n | project CorrelationId,TimeGenerated, Result, tostring(TargetResources), tostring(AdditionalDetails), OperationName\n | order by TimeGenerated desc \n",
"size": 0,
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
},
"name": "query - 4"
}
],
"fallbackResourceIds": [
"/subscriptions/b0e2eadb-68a3-451b-b8e3-4681b9a8368f/resourceGroups/az-woodgrove-rg/providers/Microsoft.OperationalInsights/workspaces/azb2c-woodgrove-logs"
],
"$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}