Skip to content

CloudWatch Agent log file_path does not working on Windows Mount Point

0

Hi

I am trying to collect logs (file based logs) from a folder that is setup as a windows Mount Point

CloudWatch seems to be able to see the path OK - but throws an errors saying

2025-11-04T01:30:54Z E! [inputs.logfile] Failed to find target files for file config E:\Path\To\Log\log*, with error: error tailing file E:\Path\To\Log\log.1 with error: The system cannot find the path specified.

I read something that said CloudWatch doesn't like symlinks and to try a UNC path

If I do that I get same / similar error

2025-11-04T03:50:29Z E! [inputs.logfile] Failed to find target files for file config \\ServerName\E$\Path\To\Log\log*, with error: error tailing file \\ServerName\E$\Path\To\Log\log.1 with error: The system cannot find the path specified.

So you can see that it the CloudWatch Agent can see the actual path and the file (log.1 is an actual file in the folder) but errors out and does not send a log to CloudWatch

I can map to this path using the UNC path as well - so it is valid and not the issue

NOTE - this works fine for a normal Windows folder structure - just not in this situation where the folder is setup as a mount point (and no this cant be changed)

Not sure if there is a way around this?

many thanks

asked 9 months ago210 views

1 Answer
0

The issue you're experiencing with CloudWatch Agent not being able to collect logs from Windows mount points is related to how the agent handles certain path types in Windows environments.

CloudWatch Agent has known limitations when dealing with non-standard Windows paths, including symlinks and mount points. The agent doesn't properly resolve these paths, which is why you're seeing the "system cannot find the path specified" error despite the path being valid and accessible through normal Windows operations.

Based on similar issues reported with symlinks, the CloudWatch Agent attempts to interpret the path literally rather than following the mount point to the actual location, causing path resolution problems.

Here are some potential workarounds you could try:

  1. Create a simple copy job that copies the logs from the mount point to a standard folder path that CloudWatch Agent can access directly.

  2. Try specifying the encoding parameter in your CloudWatch Agent configuration. Some users have reported success by explicitly setting the encoding (such as "UTF-8" or "UTF-16") in their configuration.

  3. If the CloudWatch Agent service is having trouble with state information, you could try:

  • Stopping the AmazonCloudWatchAgent service
  • Deleting state files under "{Install_Directory}\AmazonCloudWatchAgent\Logs\state*"
  • Editing your configuration file
  • Restarting the service
  1. Make sure you're using the latest version of the CloudWatch Agent, as some path handling issues may have been addressed in newer versions.

Unfortunately, if the mount point structure cannot be changed as you mentioned, and these workarounds don't resolve the issue, you might need to implement an alternative logging solution that can handle Windows mount points properly.
Sources
CloudWatch not resolving symlinks | AWS re:Post
Amazon CloudWatch Agent File Encodings Not Working | AWS re:Post

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.