Provide a groovy script to customize event process, will be executed when job is completed

You can customize the events sent to splunk by call:
  
//send job metadata and junit reports with page size set to 50 (each event contains max 50 test cases)
def results = getJunitReport(50)
def buildEvent = getBuildEvent()
results.eachWithIndex { junitResult, idx ->
    Map pagedEvent = buildEvent + ["testsuite": junitResult, "page_num": idx + 1]
    send(pagedEvent)
}
archive(includes: "**/*.log",fileSizeLimit:"500MB")

you can reference below variables or methods
 
AbstractBuild build;
Map env;
Action getAction(Class type);
Action getActionByClassName(String className);
//send message to splunk
boolean send(Object message);
//Archive all configured artifacts from slave, with each file size limit to 10MB, using ant patterns defined in http://ant.apache.org/manual/Types/fileset.html
archive(String includes, String excludes = null, boolean uploadFromSlave = false, String fileSizeLimit = "")
//will send build parameters as metadata and with the object returned from closure to splunk
sendReport(Closure closure)
//a junit report with summary of passes,failures,skips and details of testcase
getJunitReport()
//a a list of junit report each with summary of passes,failures,skips and details of testcase
//each report contains max pageSize testcases
getJunitReport(int pageSize)