Forum Discussion

Ullas Kumble's avatar
Ullas Kumble
Icon for Microsoft rankMicrosoft
Jan 22, 2018

Log Analytics query with pivot

i am trying to write a pivot query 

app("PaymentsAppInsights").customEvents
| where name == "PublishToTenantSuccess"
| where customDimensions.["TenantName"] == "UST"
| project SourceTransactionId = tostring(customDimensions.["SourceTransactionId"]),                      
          StatusCode          = tostring(customDimensions.["StatusCode"]),                      
          SapTimeStamp        = todatetime(customDimensions.["SapTimeStamp"])
| where SapTimeStamp > ago(1d)
| order by SourceTransactionId, SapTimeStamp asc
| evaluate pivot(StatusCode)

and i am getting this error. what am i doing wrong here? 

One or more pattern references were not declared. Detected pattern references: Support id: 6a44b86f-91c5-4aba-b163-1598a59cd314

  • Benny Bauer's avatar
    Benny Bauer
    Copper Contributor

    I was able to reproduce it too with my query. It happens to me only when using app().

     

    The following produces the same error:

    app('MY_APP').customEvents
    | where ....
    ....
    | evaluate pivot(name, sum(sum_dcount_user_Id))

     

    While, this one works (when running in MY_APP):

    customEvents
    | where ....
    ....
    | evaluate pivot(name, sum(sum_dcount_user_Id))

     

     

Resources