使用 属性 名称中的句点过滤自定义维度
Filter Custom Dimension with Period in Property Name
在 this guide 之后,我看到了如何根据自定义维度进行过滤,但我如何在有“.”时进行过滤在键 / 属性 name?
例如,我想根据此自定义维度值过滤 ServiceFabric.ServiceTypeName
:
{
"AspNetCoreEnvironment": "Production",
"ServiceFabric.ApplicationTypeName": "MyCompany.MyAppType",
"ServiceFabric.ServiceTypeName": "MyService",
"ServiceFabric.ApplicationName": "fabric:/MyCompany.MyApp",
"ServiceFabric.PartitionId": "some-guid",
"ServiceFabric.ServiceName": "fabric:/MyCompany.MyApp/MyService",
"ServiceFabric.InstanceId": "55555",
"ServiceFabric.NodeName": "my-node",
"CategoryName": "Microsoft.AspNetCore.Hosting.Internal.WebHost",
"Protocol": "HTTP/1.1",
"Host": "MyCompany.com",
"Method": "GET",
"Scheme": "https",
"Path": "/api/values"
}
以下无效...
traces
| extend type = customDimensions.ServiceFabric.ApplicationTypeName
| where type == "MyCompany.MyAppType"
| order by timestamp desc
具有特殊含义的名称的语法是:
customDimensions["ServiceFabric.ApplicationTypeName"]
您也可以使用方括号+引号来命名列:
| extend ["This is a column with spaces"] = blah
或
| project-rename ["Name with space"] = name
来自:https://docs.loganalytics.io/docs/Learn/References/Naming-principles
- Entity names that include special characters must be quoted using
['
and ']
or using ["
and "]
- Entity names that are language keywords must be quoted quoted using
['
and ']
or using ["
and "]
在 this guide 之后,我看到了如何根据自定义维度进行过滤,但我如何在有“.”时进行过滤在键 / 属性 name?
例如,我想根据此自定义维度值过滤 ServiceFabric.ServiceTypeName
:
{
"AspNetCoreEnvironment": "Production",
"ServiceFabric.ApplicationTypeName": "MyCompany.MyAppType",
"ServiceFabric.ServiceTypeName": "MyService",
"ServiceFabric.ApplicationName": "fabric:/MyCompany.MyApp",
"ServiceFabric.PartitionId": "some-guid",
"ServiceFabric.ServiceName": "fabric:/MyCompany.MyApp/MyService",
"ServiceFabric.InstanceId": "55555",
"ServiceFabric.NodeName": "my-node",
"CategoryName": "Microsoft.AspNetCore.Hosting.Internal.WebHost",
"Protocol": "HTTP/1.1",
"Host": "MyCompany.com",
"Method": "GET",
"Scheme": "https",
"Path": "/api/values"
}
以下无效...
traces
| extend type = customDimensions.ServiceFabric.ApplicationTypeName
| where type == "MyCompany.MyAppType"
| order by timestamp desc
具有特殊含义的名称的语法是:
customDimensions["ServiceFabric.ApplicationTypeName"]
您也可以使用方括号+引号来命名列:
| extend ["This is a column with spaces"] = blah
或
| project-rename ["Name with space"] = name
来自:https://docs.loganalytics.io/docs/Learn/References/Naming-principles
- Entity names that include special characters must be quoted using
['
and']
or using["
and"]
- Entity names that are language keywords must be quoted quoted using
['
and']
or using["
and"]