0

In AWS Data Migration service, you can turn on validation. This will create a table on your target server called awsdms_validation_failures_v1 (in the awsdms_control database). This table will be populated with each validation failure that occurs. In this table, there is a DETAILS field, that is supposed to be JSON. However, I am not able to parse this JSON, because it seems to be invalid.

Example:

[[{'timestamp': '2018-10-28 01:00:01.000000'}, {'timestamp': '2018-10-28 00:00:01.000000'}],]

Is this a AWS bug? How can I parse these results in PHP? (For example, I want to get the column name, in this case timestamp)

onok
  • 271
  • 1
  • 2
  • 5
  • Not sure how they could pretend that was JSON. The single quotes would need to be double quotes, and the last `,` needs to be removed. – CBroe Jun 14 '23 at 07:11

1 Answers1

0

I worked around the problem by manually fixing the broken JSON with str_replace statements, to replace the single quotes with double quotes, and remove the last comma.

$s = str_replace('\'', '"', $s);

$pos = strrpos($s, ',');
if ($pos !== false) {
    $s = substr_replace($s, '', $pos, 1);
}
onok
  • 271
  • 1
  • 2
  • 5