2

按照本指南,我看到了如何过滤自定义维度,但是当有“。”时如何过滤。在键/属性名称中?

例如,我想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 
4

1 回答 1

8

具有特殊含义的名称的语法是:

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

  • 包含特殊字符的实体名称必须使用['and']或使用["and引用"]
  • 作为语言关键字的实体名称必须使用['and']或使用["and引用"]
于 2018-04-11T17:33:33.870 回答