Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
function transform_payload(payload) {
var headers = {"content-type": "application/json",
"X-Insert-Key": "newrelic-insights-insert-api-key"};
var body = [{"eventType": payload["event"],
"timestamp": Date.parse(payload["timestamp"]),
"session_id": payload["session"]}];
return {"status": "ok", "headers": headers, "body": body};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment