skip to Main Content

I need to create a query to find logs where I can see requests and traces together and analyse if User SQL input queries are wrong?

I could not find schéma over logs tables and how to join them ?

How I can do it ?

Simple query in Application Insight logs analytics

2

Answers


  1. Chosen as BEST ANSWER

    the solution was :exceptions | project exceptionTimestamp = timestamp, operation_Id, operation_Name, outerMessage, exceptionCorrelationId = tostring(parse_json(customDimensions).correlationId), details | join ( traces | project traceTimestamp = timestamp, operation_Id, message, traceCorrelationId = tostring(parse_json(customDimensions).correlationId) ) on $left.exceptionCorrelationId == $right.traceCorrelationId | project exceptionCorrelationId, traceCorrelationId, traceTimestamp, exceptionTimestamp, operation_Name, message, outerMessage, details | where outerMessage contains "Execution Timeout Expired" and message contains "Executing query:" | order by exceptionTimestamp desc


  2. Usually, depending on your app, you can do that by using e.g. the operation_Id:

    requests
    | project timestamp, operation_Id, operation_Name, resultCode
    | join (
       traces
       | project timestamp, operation_Id, message
    ) on operation_Id
    | project timestamp, operation_Name, message, resultCode
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search