cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

PurgeAuditData Not Working

rattmice
12-Amethyst

PurgeAuditData Not Working

I'm running ThingWorx 9.3.0 with a PostgreSQL persistence provider and the Audit Subsystem is enabled and capturing lots of audit data (just shy of 1M rows in under a week).  I can run ExportOnlineAuditData to export the data to compressed and localized JSON and I can also run ArchiveAuditHistoryDirectPersistence although I'm not sure what to expect when it runs.

 

But when I run PurgeAuditData the audit log data is still in the database which I can see in Composer and by using pgAdmin to query the audit_subsystem_data table.

 

Why is the audit table not getting purged?

ACCEPTED SOLUTION

Accepted Solutions

Hi @rattmice

What is the value of the DaysOnline in the Audit subsystem?

If it's zero, the purge service is called, and you still see data in DB, then you should raise a bug for this.

By default I see in Help Center that the value is 60, so probably that is the problem here?

Note: I assume you switched to the Direct Persistence

View solution in original post

3 REPLIES 3

Hi @rattmice

What is the value of the DaysOnline in the Audit subsystem?

If it's zero, the purge service is called, and you still see data in DB, then you should raise a bug for this.

By default I see in Help Center that the value is 60, so probably that is the problem here?

Note: I assume you switched to the Direct Persistence

Vladimir,

 

Thank you!  That was it and I didn't read the instructions very well.  When setting the number of days to 1 then most of the rows were purged.  What is not clear is why there is a PurgeAuditData service if you can't invoke it directly and the purge is actually based on the configuration value.  It is kinda like a morphine button in the hospital - it will only dispense the drug after you've reached a certain time since the last time it was administered.  I keep pushing that button thinking data will purge but it won't.

 

And yes, this is with the Direct Persistence.  In my case I'm testing with PostgreSQL but the client is using Azure SQL.  Bonus points if you know if that will work in Azure SQL

 

-Matt

From the HC: "This [Direct Persistence] implementation can be used with PostgreSQL or MSSQL databases used as Persistence Providers for ThingWorx Platform instances". Send some documentation feedback for this subject Matt (https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Composer/System/Subsystems/AuditSubsystem.html#), to see if it's still correct.

Announcements

Top Tags