It may be useful to purge the job logs. Too many logs can slow down the application and decrease its performance.


But doing it manually can be tedious : 



You can use xDM rest Api to purge these logs:


Use the endpoint : /app-builder/data-locations/<dloc-name >/purge-jobs 

Don't forget to indicate the data location name (<dloc-name >)


If you want to purge all logs older than 7 days you can use the following payload :


{  
    "period""before 7 days"
}


Also, you have the possibility to add more filters:

  • Job Type, list of job types to purge: "INSTALL_DDL_JOB", "INTEGRATION_JOB", "PURGE_JOB"
  • Job Names, list of job name patterns. A job whose name matches any of the patterns is considered for the purge. Each pattern is expressed with a SQL 'Like' syntax, using the _ and % wildcards. 
  • Job Owners, list of job owner name patterns. A job whose owner's name matches any of the patterns is considered for the purge. Each pattern is expressed with a SQL 'Like' syntax, using the _ and % wildcards.  
  • job Status, list of job statuses to purge: "DONE", "ERROR", "RUNNING", "STOPPED", "STARTING", 

           "SUSPENDED", "WARNING"

  • period, Period to consider for the purge.

    It is expressed with after | before <number> <time_unit>, where <time_unit> is one of execution, executions, second, seconds, minute, minutes, day, days, week, weeks, month, months

    Examples

    • before 7 days: All logs older than 7 days
    • after 1 week : All logs from the past week
    • after 100 executions: The last 100 executed jobs
    • before 100 executions: All but the last 100 executed jobs

Payload sample : 

{    

    "jobTypes": ["INSTALL_DDL_JOB"],

     "jobNames": ["_ustomer%"],
     "jobOwners": ["%doe%"],
     "jobStatus": ["DONE"],
     "period""before 7 days"
}