Forum Discussion
AppDynamics Javascript Injection iRule for monitoring
Herewith iRule for AppDynamics Javascript Injection iRule
In this iRule /title has been replaced and javascript has been injected
========================================
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/"}{
set enableEum 1
HTTP::header remove "Accept-Encoding"
}
# Disable the stream filter for client requests as we are only interested in the server response
STREAM::disable
}
when HTTP_RESPONSE {
STREAM::disable
if {($enableEum == 1) && ([HTTP::header "Content-Type"] starts_with "text/html")}{
STREAM::expression "@</title>@</title><script>window\[\'adrum-start-time\'\] = new Date().getTime();(function(config)\{config.appKey = \'EEE-EEE-EEE\';config.adrumExtUrlHttp = \'http://cdn.appdynamics.com\';config.adrumExtUrlHttps = \'https://cdn.appdynamics.com\';config.beaconUrlHttp = \'http://col-eum-abcd.com\';config.beaconUrlHttps = \'https://col-eum-abcd.com\';config.xd = \{enable : false\};\})(window\[\'adrum-config\'\] || (window\[\'adrum-config\'\] = \{\}));</script><script type=\'text/javascript\' src=\'//cdn.appdynamics.com/adrum/adrum-latest.js\'></script>@"
STREAM::enable
}
}
============================
Stream profile also required for this.
This iRule has been tested and working successfully
Regards
JRahm - looks to me like Viv_Richards (thanks Viv_Richards) has a good candidate for CrowdSRC codeshare?
If you agree - let's nominate this up.- JRahmAdmin
for sure...clever use of the stream profile!
Cool - thanks JRahm.
I nominated this to become a CrowdSRC codeshare article Viv_Richards.
PS. Getting a "clever" rating from Jason is, IMO, a feather in your cap. 🎓
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com