BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Want to sponsor BOB? 
Want to sponsor BOB? (Opens a new window)  

General Notice: No events within the next 45 days.

Audit data queued up


 
Search this topic... | Search Auditor... | Search Box
Register or Login to Post    Forum Index -> Other Products -> Auditor  Previous TopicPrint TopicNext Topic
Author Message
victornguyen
Forum Member
Forum Member



Joined: 18 Oct 2018

Posts: 2



PostPosted: Thu Oct 18, 2018 10:08 am 
Post subject: Audit data queued up

Our audit data has been writing to the audit database for a couple months now. The text files are still in the audit directory. There was a connection issue that went unnoticed, which we will be resolving shortly. Can I expect, once this connection is restored, that all 2 months of audit text will make its way into the audit database. Is there anything special I need to do to make sure this happens other than to be patient as CMS processes the backlog?
Back to top
viru4808
Principal Member
Principal Member



Joined: 09 Jan 2008
ASUG Icon
Posts: 139
Location: somewhere in universe


flag
PostPosted: Fri Oct 19, 2018 12:16 am 
Post subject: Re: Audit data queued up

In CMC under Auditing check the duration of "Last Polling Cycle Duration (Seconds) 180 " this is the default setting and if you haven't changed the CMS Server tries to write Audit files every 3 Minutes.

Once you've correctly configured Connections details CMS should try to write all pending events. Depending on the number of Events in backlog wait for some time maybe ~15 Minutes and check if there's any difference.

Good luck
Back to top
Marek Chladny
Forum Advocate
Forum Advocate



Joined: 27 Nov 2003

Posts: 19227
Location: Bratislava


flag
PostPosted: Fri Oct 19, 2018 1:28 am 
Post subject: Re: Audit data queued up

[Moderator Note: Moved from General Discussion to Auditor]
Back to top
joepeters
Forum Fanatic
Forum Fanatic



Joined: 29 Aug 2002

Posts: 6438
Location: Connecticut, USA


flag
PostPosted: Fri Oct 19, 2018 6:31 am 
Post subject: Re: Audit data queued up

Depends on the version. In XIr2 and XI3 the staged audit data would be loaded upon CMS restart but not in BI4.

You can load it manually, but it takes some massaging. In particular, the event time stamp is recorded as milliseconds from some seemingly arbitrary date/time. Once you find that date/time you can use it it to calculate the actual event date/time.

Joe
Back to top
Atul Chowdhury
Forum Associate
Forum Associate



Joined: 07 Jul 2003

Posts: 819
Location: New Jersey



PostPosted: Fri Oct 19, 2018 4:28 pm 
Post subject: Re: Audit data queued up

Hi Joe,

I'm curious -- what method do you use to do this:

Quote:
You can load it manually, but it takes some massaging

_________________
Atul Chowdhury @ Infolytik
http://www.infolytik.com
Back to top
joepeters
Forum Fanatic
Forum Fanatic



Joined: 29 Aug 2002

Posts: 6438
Location: Connecticut, USA


flag
PostPosted: Mon Oct 22, 2018 12:52 pm 
Post subject: Re: Audit data queued up

Java... Just a program that opens each text file in the directory, does the magic with the start date, and inserts the results into ads_event and ads_event_detail. I also have to do a couple of lookups in the CMS to get the user name and object name from CUIDs. Here's the meat of the program:
Code:
       PreparedStatement psInsertEvent = conn.prepareStatement("insert into ads_event_import (event_id,cluster_id,server_id,service_type_id,client_type_id,start_time,duration_ms,added_to_ads,user_id,user_name,session_id,action_id,sequence_in_action,event_type_id,status_id,object_id,object_name,object_type_id,object_folder_path,top_folder_name,top_folder_id,folder_id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
       PreparedStatement psInsertDetail = conn.prepareStatement("insert into ads_event_detail_import (event_id,event_detail_id,event_detail_type_id,bunch,event_detail_value) values (?,?,?,?,?)");

      File dir = new File(auditPath);
      String line;
      Integer fileCounter = dir.listFiles().length;
      
      for(File file : dir.listFiles())
      {
         fileCounter--;
         if(file.getName().startsWith("done-"))
            continue;
         Integer lineCounter = 0;
            try (FileReader fileReader =  new FileReader(file);
             BufferedReader bufferedReader =  new BufferedReader(fileReader))
            {

            while((line = bufferedReader.readLine()) != null)
            {
               System.out.println("File " + fileCounter + ", line " + lineCounter++);
               String splitted[] = line.split("\t");
               String eventID = splitted[0];
               Integer eventTypeID = new Integer(splitted[1]);
               String sessionID = splitted[2];
               String clientTypeID = splitted[3];
               String objectCUID = splitted[4];
               String serviceTypeID = splitted[5];
               Integer something = new Integer(splitted[6]);
               Long startTime = new Long(splitted[7]);
               Integer duration = new Integer(splitted[8]);
               String userCUID = splitted[9];
               String actionID = splitted[10];
               Integer sequenceInAction = new Integer(splitted[11]);
               Integer statusID = new Integer(splitted[12]);
               String userName = null;
               
               IInfoObject ioUser = infoStore.getIoBySQL("select si_name from ci_systemobjects where si_cuid = '" + userCUID + "'");
               if(ioUser != null)
                  userName = ioUser.getTitle();
               
               String details = null;
               if(splitted.length > 13)
                  details = splitted[13];

               Date adjStartTime = null;
               
               if(!timeOffsets.containsKey(something))
                  throw new Exception ("Unexpected something: " + something);

               adjStartTime = new Date(startTime + timeOffsets.get(something));

               String objectName = null;
               String objectTypeID = null;
               String objectPath = null;
               String topFolderName = null;
               String topFolderID = null;
               String folderID = null;
               
               IInfoObject ioObject = infoStore.getIoBySQL("select si_name,si_kind from ci_systemobjects where si_cuid = '" + objectCUID + "'");

               if(ioObject != null)
               {
                  if(!ioObject.properties().containsKey(CePropertyID.SI_KIND))
                  {
                     System.out.println("Skipping object: " + ioObject.getTitle());
                     continue;
                  }

                  objectName = ioObject.getTitle();
                  objectTypeID = infoStore.getIoBySQL("select si_cuid from ci_systemobjects where si_plugin_object = 1 and si_kind = '" + ioObject.getKind() + "'").getCUID();
                  
                  IInfoObject tempO = ioObject;
                  while(tempO.getParentID() != 4 && tempO.getParentID() != 0) 
                  {
                     tempO = tempO.getParent();
                     if(folderID == null)
                        folderID = tempO.getCUID();
                     
                     if(objectPath == null)
                        objectPath = "/" + tempO.getTitle() + "/";
                     else
                        objectPath = "/" + tempO.getTitle() + objectPath;
                     
                     topFolderName = tempO.getTitle();
                     topFolderID = tempO.getCUID();
                  }
               }
Back to top
Atul Chowdhury
Forum Associate
Forum Associate



Joined: 07 Jul 2003

Posts: 819
Location: New Jersey



PostPosted: Mon Oct 22, 2018 3:47 pm 
Post subject: Re: Audit data queued up

Good stuff, Joe -

Thanks!

_________________
Atul Chowdhury @ Infolytik
http://www.infolytik.com
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Other Products -> Auditor  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0352 seconds using 17 queries. (SQL 0.0029 Parse 0.0010 Other 0.0313)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo