diff --git a/handlers/convertCloudfrontFieldTypes.js b/handlers/convertCloudfrontFieldTypes.js new file mode 100644 index 0000000..001ab5e --- /dev/null +++ b/handlers/convertCloudfrontFieldTypes.js @@ -0,0 +1,16 @@ +exports.process = function(config) { + console.log('convertCloudfrontFieldTypes'); + + var records = config.data; + + for (var i = 0; i < records.length; i++) { + var record = records[i]; + + record['sc-bytes'] = parseInt(record['sc-bytes']); + record['sc-status'] = parseInt(record['sc-status']); + record['cs-bytes'] = parseInt(record['cs-bytes']); + record['time-taken'] = parseFloat(record['time-taken']); + } + + return Promise.resolve(config); +};