Created
August 25, 2017 14:28
-
-
Save khpeet/068e332c9dac913ea6a795fc79565001 to your computer and use it in GitHub Desktop.
Send Akami headers via NR Synthetic script to Insights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
--------- SCRIPT SUMMARY --------- | |
Author(s) : Keagan Peet | |
Date : 8/24/17 | |
Version : 1.0.0 | |
Notes : Akami response headers to Insights for a single page. | |
*/ | |
var assert = require('assert'); | |
var request = require('request'); | |
var options = { | |
url: 'Insert_YOUR_URL or ENDPOINT', //modify this to a specific element or another URL if needed. | |
headers: { | |
'Pragma': 'akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no, akamai-x-get-request-id, akamai-x-request-trace, akamai-x--meta-trace, akama-xi-get-extracted-values' | |
} | |
}; | |
request.get(options, function aRequest(error, response, body) { | |
if (!error && response.statusCode == 200) { | |
var object = response.headers; | |
//console.log(object); | |
for (var i in object){ | |
console.log(i + ":" + object[i]); | |
$util.insights.set(i, object[i]); // send key/value pair to insights | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment