Collect IIS logs with AMA agent into Log Analytics

Silberman, Oleg 5 Reputation points
2023-02-01T14:52:07.9433333+00:00
It does not matter, if this optional field "File pattern" is empty or filled in the error is "InvalidIisLogsDirectory" (see the error in JSON format below).

Update Error - 'Log Directories' value 'E:\LOGS-IIS\Default Web Site\W3SVC1

{
  "code": "DeploymentFailed",
  "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
  "details": [
    {
      "code": "InvalidIisLogsDirectory",
      "message": "'Log Directories' value 'E:/LOGS-IIS/myWebApp/*.log' is invalid."
    }
  ]
}
Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,800 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Stanislav Zhelyazkov 21,101 Reputation points MVP
    2023-02-02T09:22:29.3533333+00:00

    Hi,

    It is unclear what is the value for your logs directory in your data collection rule but I would assume it is "E:/LOGS-IIS/myWebApp/*.log". I believe you do not have to define wild cards, you need to define only the path like "E:\LOGS-IIS\myWebApp". The data collection rule will automatically pick the logs from there. You only need to make sure that your IIS server is set to write into that directory, format is W3C, encoding is UTF-8 and that for example new logs are created on schedule Hourly.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


  2. Asa Engleman 5 Reputation points
    2024-02-21T18:12:36.62+00:00

    I saw a similar thread where wildcards are only accepted using AMA custom logs, not IIS. We have a similar issue as each web site creates its own subdirectory and AMA does not honor it. https://learn.microsoft.com/en-us/answers/questions/1164675/iis-log-ingestion-using-ama-agents-for-multiple-ii

    0 comments No comments