5 Replies Latest reply on Dec 17, 2016 9:45 AM by gachen

    View xml from audit databases

    KenYoshizawa

      Hi Community,I generated a XML file from audit database with pidiag.

      I opened it with text editor but it was too much information for end user to read.

      Then I opened it with Excel but coud not be opened because there is no schema file for the XML file.

      Is there any other way to see a XML file easier?

        • Re: View xml from audit databases
          jsanchezcolunga

          Hi ken,

           

          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:

          4 Ways to Open XML - wikiHow 

           

          Let me know if you have any comment or question.

           

          Thank you,

           

          José

            • Re: View xml from audit databases
              KenYoshizawa

              Hi Jose,

               

               

              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?

               

               

              Thank you,

               

              Ken

            • Re: View xml from audit databases
              gachen

              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?

                • Re: View xml from audit databases
                  KenYoshizawa

                  Hi Gavin,

                   

                  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?

                   

                  Thank you,

                   

                  Ken

                    • Re: View xml from audit databases
                      gachen

                      Hi Ken,

                       

                      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.

                      2 of 2 people found this helpful