Azure application insights 避免在查询中多次运行函数

Azure application insights 避免在查询中多次运行函数,azure-application-insights,ms-app-analytics,Azure Application Insights,Ms App Analytics,在下面的查询中,我在同一个查询中多次运行该函数 第一次调用后是否可以重用parsejson函数中的数据?现在我在查询中调用了三次。我想看看只打一次电话是否会更有效率 EventLogs | where Timestamp > ago(1h) and tostring(parsejson(tostring(Data.JsonLog)).LogId) =~ '567890' | project Timestamp, fileSize = toint(parse

在下面的查询中,我在同一个查询中多次运行该函数

第一次调用后是否可以重用parsejson函数中的数据?现在我在查询中调用了三次。我想看看只打一次电话是否会更有效率

EventLogs
| where Timestamp > ago(1h)  
        and tostring(parsejson(tostring(Data.JsonLog)).LogId) =~ '567890'
|   project Timestamp, 
    fileSize = toint(parsejson(tostring(Data.JsonLog)).fileSize),  
    pageCount = tostring(parsejson(tostring(Data.JsonLog)).pageCount)
| limit 10
您可以使用extend进行以下操作:

EventLogs
| where Timestamp > ago(1h)
| extend JsonLog = parsejson(tostring(Data.JsonLog)
| where tostring(JsonLog.LogId) =~ '567890'
|   project Timestamp, 
    fileSize = toint(JsonLog.fileSize),  
    pageCount = tostring(JsonLog.pageCount)
| limit 10