As need to store the errors in snowflake database table that is which component failed and what is the error when run the job, if job failed. We got Component start and Completed date, status(Success or Fa). but unable to capture Error when job got failed
Hi @Ss114805,
What are you using to capture the error and insert it into a Snowflake table? The Matillion API will divulge what you are looking for. You should be able to use the API Profile to grab all the info you need and then use the API Query component to insert it into a Snowflake table.
This is the API Profile we use extract all the job history down to the individual task/component level:
<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<api:info title="Baseline" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<attr name="executionid" xs:type="string" other:xPath="/id" />
<attr name="jobtype" xs:type="string" other:xPath="/type" />
<attr name="customerid" xs:type="string" other:xPath="/customerID" />
<attr name="groupname" xs:type="string" other:xPath="/groupName" />
<attr name="projectid" xs:type="string" other:xPath="/projectID" />
<attr name="projectname" xs:type="string" other:xPath="/projectName" />
<attr name="versionid" xs:type="string" other:xPath="/versionID" />
<attr name="versionname" xs:type="string" other:xPath="/versionName" />
<attr name="jobid" xs:type="string" other:xPath="/jobID" />
<attr name="jobname" xs:type="string" other:xPath="/jobName" />
<attr name="environmentid" xs:type="string" other:xPath="/environmentID" />
<attr name="environmentname" xs:type="string" other:xPath="/environmentName" />
<attr name="state" xs:type="string" other:xPath="/state" />
<attr name="enqueuedtime" xs:type="string" other:xPath="/enqueuedTime" />
<attr name="starttime" xs:type="string" other:xPath="/startTime" />
<attr name="endtime" xs:type="string" other:xPath="/endTime" />
<attr name="message" xs:type="string" other:xPath="/message" />
<attr name="rowcount" xs:type="string" other:xPath="/rowCount" />
<attr name="taskid" xs:type="string" other:xPath="/tasks/taskID" />
<attr name="taskparentid" xs:type="string" other:xPath="/tasks/parentID" />
<attr name="tasktype" xs:type="string" other:xPath="/tasks/type" />
<attr name="taskjobID" xs:type="string" other:xPath="/tasks/jobID" />
<attr name="taskjobname" xs:type="string" other:xPath="/tasks/jobName" />
<attr name="taskjobrevision" xs:type="string" other:xPath="/tasks/jobRevision" />
<attr name="taskjobtimestamp" xs:type="string" other:xPath="/tasks/jobTimestamp" />
<attr name="taskcomponentid" xs:type="string" other:xPath="/tasks/componentID" />
<attr name="taskcomponentname" xs:type="string" other:xPath="/tasks/componentName" />
<attr name="taskstate" xs:type="string" other:xPath="/tasks/state" />
<attr name="taskrowcount" xs:type="string" other:xPath="/tasks/rowCount" />
<attr name="taskstarttime" xs:type="string" other:xPath="/tasks/startTime" />
<attr name="taskendtime" xs:type="string" other:xPath="/tasks/endTime" />
<attr name="taskmessage" xs:type="string" other:xPath="/tasks/message" />
<!-- Below are a the expected parameters to be passed in. In this case a Project Group and Project Name -->
<input name="Group_Name" xs:type="string" />
<input name="Project_Name" xs:type="string" />
<input name="Start_Date" xs:type="string" />
<input name="Start_Time" xs:type="string" />
<input name="End_Date" xs:type="string" />
<input name="End_Time" xs:type="string" />
</api:info>
<api:set attr="BackwardsCompatibilityMode" value="true" />
<api:set attr="ContentType" value="application/json" />
<api:set attr="DataModel" value="DOCUMENT" />
<!-- The below attribute forces a resultset to have a row for each task in the tasks array -->
<api:set attr="RepeatElement" value="/" />
<api:set attr="SubRepeatElement" value="/tasks" />
<api:set attr="URI" value="http://127.0.0.1:8080/rest/v1/group/name/[_input.Group_Name]/project/name/[_input.Project_Name]/task/filter/by/start/range/date/[_input.Start_Date]/time/[_input.Start_Time]/to/date/[_input.End_Date]/time/[_input.End_Time]" />
<api:script method="GET">
<api:call op="jsonproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>
I hope this helps!