Microsoft Virtualization Discussions

PowerShell SnapMirror Audit Log Parser for CDOT

The SnapMirror audit log provides a running log of SnapMirror relationships. It shows starting, restarting, and ending information for each SnapMirror relationship. This script reads in the log file(s) and parses the information into a usable CSV or XLSX file. The output produces the following details:


  • Source (the source of the SnapMirror relationship)
  • Destination (the destination of the SnapMirror relationship
  • Type (request, start, or end)
  • KB Transferred (produced only for end type entries)
  • Time Stamp (the time stamp associated with the log file entry)
  • Duration (recorded in seconds)
  • Throughput (in KB/s)
  • Concurrency (number of total SnapMirrors transferring during any part of the time this SnapMirror was transferring)

The similar 7-mode parser script can be found here:


Please let me know of any feedback in the comments section.


Re: PowerShell SnapMirror Audit Log Parser for CDOT

This is pretty great - thank you so much! A couple of questions.


  • The CSV outputs multiple lines for the same job, since any given snapmirror job is set to kick off at least once per day. Is there any way to account for date and time-stamps?
  • A significant number of the jobs list a negative request-to-end, and therefore throughput; e.g., -2681.01934 KB/s. This only seems to happen if a job's start time is toward the end of the day (say, around 23:00), and finishes sometime the next day (say, around 03:00)
  • A given job might start on one day, but not finish until several days later, because networking or size of the job or any number of other reasons. Is it possible to account for that?

Thanks so much for your hard work on this one. I'm in the beginning stages of learning PowerShell, so your script is quite an education, but some parts are definitely outside of my current knowledge level.

Re: PowerShell SnapMirror Audit Log Parser for CDOT

Awesome !


I had been looking for a cDOT parser script like this for a long time.


Thanks for your work.

Thanks for sharing this script.

Re: PowerShell SnapMirror Audit Log Parser for CDOT

Thanks for all the feedback.  Take a look at the new version I just posted.  I think it addresses the issues you were experiencing.  Also, I added a new option to export to Excel format (requires a module, described in the comment section).

Re: PowerShell SnapMirror Audit Log Parser for CDOT

Make a quick update today.  Changed the throughput calculation based upon the time the SnapMirror is actually running instead of the time from when it was requested.  Should give a better picture of actual throughput.

Re: PowerShell SnapMirror Audit Log Parser for CDOT

I had a request to add a "concurrency" field to show the number of other SnapMirror transfers that were transferring during the time that particular SnapMirror transfer was transferring.  I added that to this most current version.


P.S.  If you aren't using the export to Excel parameter, you really should consider it.  Really presents the data more easily to work with.  It just takes the module to be installed that is mentioned in the help comments.  

Re: PowerShell SnapMirror Audit Log Parser for CDOT

Excellent, thanks a bunch. I look forward to giving this one a spin!

Re: PowerShell SnapMirror Audit Log Parser for CDOT

I had someone contact me about the order the files were being pulled from the cluster were alphabetical instead of numeric which meant they were out of order.  Good catch!  Fixed it and attached again.

View solution in original post

Re: PowerShell SnapMirror Audit Log Parser for CDOT


What about adding a field that indicates if the snapmirror is an "initial" snapmirror or if it is an update?

For the most part, I can determine that on my own especially if I'm the one who created the snapmirror.

But thought it might be a good field to include, if I have to pull a report in a hurry for a manager.


Thanks and Regards,


Cloud Volumes ONTAP
Review Banner
All Community Forums