0

I have a Azure Web Application in Azure. I have one endpoint : https://dev-my-app.azurewebsites.net/test

I would like to see all http requests which were done for this endpoint. I have read that I can use Log Analytics Workspace (https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-workspace-overview) in order to achieve it.

I have configured a workspace. I have also created Diagnostic setting which sends "HTTP logs" to the workspace :

enter image description here

After I go to the "Logs" and try to run the query

// Client requests per hour 
// Count of client requests hourly. 
AGCAccessLogs
| summarize AggregatedValue = count() by bin(TimeGenerated, 1h), _ResourceId
| render timechart

enter image description here

I am getting an error as response:

'summarize' operator: Failed to resolve table or column expression named 'AGCAccessLogs'
Request id: 1449b704-70bb-4d84-8c00-0d5b086fa637

It looks like AGCAccessLogs table does not exist in my log analytics workspace.

I have also tried to call this query directly from log analytics workspace:

enter image description here

What am I missing in order to make this query work? Is there other way to see the http traffic for my web app?

10
  • You have to run this query in log analytics workspace=>logs of your web app, refer Image. Commented Jul 31, 2024 at 10:35
  • 1
    Thats what I did, I will update question with this image Commented Jul 31, 2024 at 10:39
  • Select the log Analytics workspace you have configured under Diagonostic settings=>select view logs in Search and analyze logs=> run the query. Refer Image 1, Image 2. Commented Jul 31, 2024 at 10:49
  • 1
    I can see you are running the query under Web App=>Monitoring=>Logs but you have to run the query in log Analytics workspace which you have configured under Diagnostic setting. Commented Jul 31, 2024 at 11:20
  • 1
    Run AppServiceHTTPLogs to fetch the Http logs. Commented Jul 31, 2024 at 11:33

1 Answer 1

2

Follow the below steps to run the query in Logs.

AGCAccessLogs
| summarize AggregatedValue = count() by bin(TimeGenerated, 1h), _ResourceId
| render timechart
  • Configure the logging under Diagnostic setting to send Azure platform metrics, resource related logs and other activity logs to Azure log Analytics workspace.
  • Navigate to Azure web App=> Diagnostic Settings= Select the configured Analytics workspace.

enter image description here

  • It redirects to the below page, select view logs in Search and Analyze logs:

enter image description here

  • It takes you to Logs page, you can run the query to fetch the required logs.

enter image description here

Workaround 1:

To fetch the Http Logs of your web app, run AppServiceHTTPLogs query:

enter image description here

Workaround 2:

Configure Application Insights for your web app. Navigate to Azure Web App=> Settings=> Application Insights=> Logs and run the below query to fetch the Http logs:

requests
| where resultCode == 200

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.