Skip to content

Instantly share code, notes, and snippets.

@wkj
Created March 22, 2017 17:31
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save wkj/b04fabc76ee4445ed8db52b71c540604 to your computer and use it in GitHub Desktop.
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