There are several ways to open and view xml files. Apart from what you have mentioned (text editor and Excel) you could open the file with a web browser and there are also XML Viewer programs that you could download and use.
The following website explains these options. I hope you find it useful:
Let me know if you have any comment or question.
Thank you for the reply.
I tried XML browser and Web browser.
XML browser has good response but it is not suitable for end user to use.
It seems that Excel is the most userfriendly.
If I choose to use Excel, there are two problems.
1. If XML file is too big for Excel to read, is there a way to separate xml file?
(or pidiag has an option to separate output file?)
2. I generated xml file on Japanese environment.
XML file's encoding is UTF-8 but its data contains Shift-JIS.
Is there a way to specify encoding when XML file is generated?
Typically we recommend using PI AuditViewer to read the logs in the audit databases. This utility also allows you to export the audit logs as CSV, which may be easier to read than the XML form. Is there any particular reason why you are using pidiag -xa over PI AuditViewer?
I use PI Audit Viewer, but it can't show audit logs that is witten when data are written from SMT Archive Editor or PI putval.
They are only written in pisnapssAudit.dat.
Is there a way for CSV from PI AuditViewer to contain them?
The behavior you are describing is intentional - auditing on the PI Data Archive is not meant to audit "new" PI Events. That is to say, PI Events are only audited when they are edited or deleted. The reason why events you are writing from SMT Archive Editor or PI Putval are showing up in only the snapshot audit logs is likely because the events are being sent with replace mode (Archive Editor will always send with replace mode, not sure about PI Putval), but not actually replacing any existing events in the archive, hence no audit record is generated for the archive audit logs. If you're really going for capturing all incoming events to the server, this is unfortunately something that auditing was not intended to do. So I would say that viewing audit logs in PI Audit Viewer is actually the intended way that these logs are meant to be viewed.
If for whatever reason the XML output for the audit logs is still more helpful, I have attached the XML schema (XSD) file, which hopefully will make it easier to open with tools like Excel.
PIAudit.xsd.zip 4.0 KB