Skip to content

Commit

Permalink
Resource centric query for logs (#18141)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
rakshith91 and srnagar committed Nov 2, 2022
1 parent 10c39b3 commit fc3c409
Show file tree
Hide file tree
Showing 11 changed files with 3,312 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"title": "Cross Workspace Query",
"description": "A cross workspace query that the type and count of each row per workspace.",
"parameters": {
"workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111",
"query": "union * | where TimeGenerated > ago(1h) | summarize count() by Type, TenantId",
"workspaces": "draft-test,draft-test-2"
},
"responses": {
"200": {
"body": {
"tables": [
{
"name": "PrimaryResult",
"columns": [
{
"name": "Type",
"type": "string"
},
{
"name": "TenantId",
"type": "string"
},
{
"name": "count_",
"type": "long"
}
],
"rows": [
[
"Usage",
"63613592-b6f7-4c3d-a390-22ba13102111",
"1"
],
[
"Usage",
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
"1"
],
[
"BillingFact",
"63613592-b6f7-4c3d-a390-22ba13102111",
"1"
],
[
"BillingFact",
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
"1"
],
[
"Operation",
"63613592-b6f7-4c3d-a390-22ba13102111",
"7"
],
[
"Operation",
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
"5"
]
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"title": "Simple Query",
"description": "A simple query that returns query results.",
"parameters": {
"workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111",
"query": "Usage | take 10",
"timespan": "PT12H"
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5",
"x-ms-correlation-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5"
},
"body": {
"tables": [
{
"name": "PrimaryResult",
"columns": [
{
"name": "TenantId",
"type": "string"
},
{
"name": "Computer",
"type": "string"
},
{
"name": "TimeGenerated",
"type": "datetime"
},
{
"name": "SourceSystem",
"type": "string"
},
{
"name": "StartTime",
"type": "datetime"
},
{
"name": "EndTime",
"type": "datetime"
},
{
"name": "ResourceUri",
"type": "string"
},
{
"name": "LinkedResourceUri",
"type": "string"
},
{
"name": "DataType",
"type": "string"
},
{
"name": "Solution",
"type": "string"
},
{
"name": "BatchesWithinSla",
"type": "long"
},
{
"name": "BatchesOutsideSla",
"type": "long"
},
{
"name": "BatchesCapped",
"type": "long"
},
{
"name": "TotalBatches",
"type": "long"
},
{
"name": "AvgLatencyInSeconds",
"type": "real"
},
{
"name": "Quantity",
"type": "real"
},
{
"name": "QuantityUnit",
"type": "string"
},
{
"name": "IsBillable",
"type": "bool"
},
{
"name": "MeterId",
"type": "string"
},
{
"name": "LinkedMeterId",
"type": "string"
},
{
"name": "Type",
"type": "string"
}
],
"rows": [
[
"b438b4f6-912a-46d5-9cb1-b44069212abc",
"ContosoSQLSrv1",
"2017-08-24T06:59:59Z",
"OMS",
"2017-08-24T06:00:00Z",
"2017-08-24T06:59:59Z",
"/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it",
null,
"Perf",
"LogManagement",
"1",
"0",
"0",
"1",
"1.286",
"0.076408",
"MBytes",
"true",
"a4e29a95-5b4c-408b-80e3-113f9410566e",
"00000000-0000-0000-0000-000000000000",
"Usage"
],
[
"b438b4f6-912a-46d5-9cb1-b44069212abc",
"Store010Web3",
"2017-08-24T06:59:59Z",
"OMS",
"2017-08-24T06:00:00Z",
"2017-08-24T06:59:59Z",
"/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it",
null,
"Perf",
"LogManagement",
"1",
"0",
"0",
"1",
"1.7",
"0.106767",
"MBytes",
"true",
"a4e29a95-5b4c-408b-80e3-113f9410566e",
"00000000-0000-0000-0000-000000000000",
"Usage"
]
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"title": "Simple GET Query across resource",
"description": "A simple query that returns query results.",
"parameters": {
"resourceId": "/subscriptions/fffa080af-c2d8-40ad-9cce-e1a450bawb57/resourceGroups/test-resourcegroup/providers/Microsoft.Storage/storageAccounts/storageaccountname",
"query": "StorageBlobLogs | summarize count() by OperationName | top 10 by count_ desc",
"timespan": "PT24H"
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5",
"x-ms-correlation-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5"
},
"body": {
"tables": [
{
"name": "PrimaryResult",
"columns": [
{
"name": "OperationName",
"type": "string"
},
{
"name": "count_",
"type": "long"
}
],
"rows": [
[
"operation1",
"10"
]
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"title": "Cross Workspace Query",
"description": "A cross workspace query that the type and count of each row per workspace.",
"parameters": {
"workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111",
"body": {
"query": "union * | where TimeGenerated > ago(1h) | summarize count() by Type, TenantId",
"workspaces": [
"draft-test",
"draft-test-2"
]
}
},
"responses": {
"200": {
"body": {
"tables": [
{
"name": "PrimaryResult",
"columns": [
{
"name": "Type",
"type": "string"
},
{
"name": "TenantId",
"type": "string"
},
{
"name": "count_",
"type": "long"
}
],
"rows": [
[
"Usage",
"63613592-b6f7-4c3d-a390-22ba13102111",
"1"
],
[
"Usage",
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
"1"
],
[
"BillingFact",
"63613592-b6f7-4c3d-a390-22ba13102111",
"1"
],
[
"BillingFact",
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
"1"
],
[
"Operation",
"63613592-b6f7-4c3d-a390-22ba13102111",
"7"
],
[
"Operation",
"d436f322-a9f4-4aad-9a7d-271fbf66001c",
"5"
]
]
}
]
}
}
}
}
Loading

0 comments on commit fc3c409

Please sign in to comment.