Skip to content

Commit ed2b86c

Browse files
rakshith91srnagar
authored andcommitted
Resource centric query for logs (Azure#18141)
* Resource centric query * update * more params * lint * prettier * add Get * lint * comments * lint * Update specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json Co-authored-by: Srikanta <51379715+srnagar@users.noreply.github.com> * Apply suggestions from code review * Update specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-get-resource-centric-example.json * comments * Update specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json * revert / * fix resourceId * x-ms-paths * lint * avocado * fix * lint * remove path * remove x-ms-path * lint * Update specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2022-10-27_Preview/OperationalInsights.json * remove bc * avocado * remove breakinc changes * add format * missing type object Co-authored-by: Srikanta <51379715+srnagar@users.noreply.github.com>
1 parent 0aed3b3 commit ed2b86c

File tree

11 files changed

+3312
-0
lines changed

11 files changed

+3312
-0
lines changed

specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2022-10-27_Preview/OperationalInsights.json

Lines changed: 1601 additions & 0 deletions
Large diffs are not rendered by default.

specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2022-10-27_Preview/examples/batch-query-example.json

Lines changed: 609 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"title": "Cross Workspace Query",
3+
"description": "A cross workspace query that the type and count of each row per workspace.",
4+
"parameters": {
5+
"workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111",
6+
"query": "union * | where TimeGenerated > ago(1h) | summarize count() by Type, TenantId",
7+
"workspaces": "draft-test,draft-test-2"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"tables": [
13+
{
14+
"name": "PrimaryResult",
15+
"columns": [
16+
{
17+
"name": "Type",
18+
"type": "string"
19+
},
20+
{
21+
"name": "TenantId",
22+
"type": "string"
23+
},
24+
{
25+
"name": "count_",
26+
"type": "long"
27+
}
28+
],
29+
"rows": [
30+
[
31+
"Usage",
32+
"63613592-b6f7-4c3d-a390-22ba13102111",
33+
"1"
34+
],
35+
[
36+
"Usage",
37+
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
38+
"1"
39+
],
40+
[
41+
"BillingFact",
42+
"63613592-b6f7-4c3d-a390-22ba13102111",
43+
"1"
44+
],
45+
[
46+
"BillingFact",
47+
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
48+
"1"
49+
],
50+
[
51+
"Operation",
52+
"63613592-b6f7-4c3d-a390-22ba13102111",
53+
"7"
54+
],
55+
[
56+
"Operation",
57+
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
58+
"5"
59+
]
60+
]
61+
}
62+
]
63+
}
64+
}
65+
}
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
{
2+
"title": "Simple Query",
3+
"description": "A simple query that returns query results.",
4+
"parameters": {
5+
"workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111",
6+
"query": "Usage | take 10",
7+
"timespan": "PT12H"
8+
},
9+
"responses": {
10+
"200": {
11+
"headers": {
12+
"x-ms-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5",
13+
"x-ms-correlation-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5"
14+
},
15+
"body": {
16+
"tables": [
17+
{
18+
"name": "PrimaryResult",
19+
"columns": [
20+
{
21+
"name": "TenantId",
22+
"type": "string"
23+
},
24+
{
25+
"name": "Computer",
26+
"type": "string"
27+
},
28+
{
29+
"name": "TimeGenerated",
30+
"type": "datetime"
31+
},
32+
{
33+
"name": "SourceSystem",
34+
"type": "string"
35+
},
36+
{
37+
"name": "StartTime",
38+
"type": "datetime"
39+
},
40+
{
41+
"name": "EndTime",
42+
"type": "datetime"
43+
},
44+
{
45+
"name": "ResourceUri",
46+
"type": "string"
47+
},
48+
{
49+
"name": "LinkedResourceUri",
50+
"type": "string"
51+
},
52+
{
53+
"name": "DataType",
54+
"type": "string"
55+
},
56+
{
57+
"name": "Solution",
58+
"type": "string"
59+
},
60+
{
61+
"name": "BatchesWithinSla",
62+
"type": "long"
63+
},
64+
{
65+
"name": "BatchesOutsideSla",
66+
"type": "long"
67+
},
68+
{
69+
"name": "BatchesCapped",
70+
"type": "long"
71+
},
72+
{
73+
"name": "TotalBatches",
74+
"type": "long"
75+
},
76+
{
77+
"name": "AvgLatencyInSeconds",
78+
"type": "real"
79+
},
80+
{
81+
"name": "Quantity",
82+
"type": "real"
83+
},
84+
{
85+
"name": "QuantityUnit",
86+
"type": "string"
87+
},
88+
{
89+
"name": "IsBillable",
90+
"type": "bool"
91+
},
92+
{
93+
"name": "MeterId",
94+
"type": "string"
95+
},
96+
{
97+
"name": "LinkedMeterId",
98+
"type": "string"
99+
},
100+
{
101+
"name": "Type",
102+
"type": "string"
103+
}
104+
],
105+
"rows": [
106+
[
107+
"b438b4f6-912a-46d5-9cb1-b44069212abc",
108+
"ContosoSQLSrv1",
109+
"2017-08-24T06:59:59Z",
110+
"OMS",
111+
"2017-08-24T06:00:00Z",
112+
"2017-08-24T06:59:59Z",
113+
"/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it",
114+
null,
115+
"Perf",
116+
"LogManagement",
117+
"1",
118+
"0",
119+
"0",
120+
"1",
121+
"1.286",
122+
"0.076408",
123+
"MBytes",
124+
"true",
125+
"a4e29a95-5b4c-408b-80e3-113f9410566e",
126+
"00000000-0000-0000-0000-000000000000",
127+
"Usage"
128+
],
129+
[
130+
"b438b4f6-912a-46d5-9cb1-b44069212abc",
131+
"Store010Web3",
132+
"2017-08-24T06:59:59Z",
133+
"OMS",
134+
"2017-08-24T06:00:00Z",
135+
"2017-08-24T06:59:59Z",
136+
"/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it",
137+
null,
138+
"Perf",
139+
"LogManagement",
140+
"1",
141+
"0",
142+
"0",
143+
"1",
144+
"1.7",
145+
"0.106767",
146+
"MBytes",
147+
"true",
148+
"a4e29a95-5b4c-408b-80e3-113f9410566e",
149+
"00000000-0000-0000-0000-000000000000",
150+
"Usage"
151+
]
152+
]
153+
}
154+
]
155+
}
156+
}
157+
}
158+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"title": "Simple GET Query across resource",
3+
"description": "A simple query that returns query results.",
4+
"parameters": {
5+
"resourceId": "/subscriptions/fffa080af-c2d8-40ad-9cce-e1a450bawb57/resourceGroups/test-resourcegroup/providers/Microsoft.Storage/storageAccounts/storageaccountname",
6+
"query": "StorageBlobLogs | summarize count() by OperationName | top 10 by count_ desc",
7+
"timespan": "PT24H"
8+
},
9+
"responses": {
10+
"200": {
11+
"headers": {
12+
"x-ms-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5",
13+
"x-ms-correlation-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5"
14+
},
15+
"body": {
16+
"tables": [
17+
{
18+
"name": "PrimaryResult",
19+
"columns": [
20+
{
21+
"name": "OperationName",
22+
"type": "string"
23+
},
24+
{
25+
"name": "count_",
26+
"type": "long"
27+
}
28+
],
29+
"rows": [
30+
[
31+
"operation1",
32+
"10"
33+
]
34+
]
35+
}
36+
]
37+
}
38+
}
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"title": "Cross Workspace Query",
3+
"description": "A cross workspace query that the type and count of each row per workspace.",
4+
"parameters": {
5+
"workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111",
6+
"body": {
7+
"query": "union * | where TimeGenerated > ago(1h) | summarize count() by Type, TenantId",
8+
"workspaces": [
9+
"draft-test",
10+
"draft-test-2"
11+
]
12+
}
13+
},
14+
"responses": {
15+
"200": {
16+
"body": {
17+
"tables": [
18+
{
19+
"name": "PrimaryResult",
20+
"columns": [
21+
{
22+
"name": "Type",
23+
"type": "string"
24+
},
25+
{
26+
"name": "TenantId",
27+
"type": "string"
28+
},
29+
{
30+
"name": "count_",
31+
"type": "long"
32+
}
33+
],
34+
"rows": [
35+
[
36+
"Usage",
37+
"63613592-b6f7-4c3d-a390-22ba13102111",
38+
"1"
39+
],
40+
[
41+
"Usage",
42+
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
43+
"1"
44+
],
45+
[
46+
"BillingFact",
47+
"63613592-b6f7-4c3d-a390-22ba13102111",
48+
"1"
49+
],
50+
[
51+
"BillingFact",
52+
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
53+
"1"
54+
],
55+
[
56+
"Operation",
57+
"63613592-b6f7-4c3d-a390-22ba13102111",
58+
"7"
59+
],
60+
[
61+
"Operation",
62+
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
63+
"5"
64+
]
65+
]
66+
}
67+
]
68+
}
69+
}
70+
}
71+
}

0 commit comments

Comments
 (0)