Splunk AppDynamics

Injecting adrum-config.js using Apache 2.4 and Substitute?

CommunityUser
Splunk Employee
Splunk Employee

Hello,

I am trying to inject adrum-config.js into the pages using Apache and Substitute option.  

I used something like:

RequestHeader unset Accept-Encoding

<Location /confluence>
    Order deny,allow
    Allow from all
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s|<head>|<head><script src='/appdyn/adrum/adrum-config.js'></script>|in"
</Location>

I see in developer tool that the line is added, but it keeps complaining:

Uncaught SyntaxError: Unexpected token <

It seems unhappy that line one in the adrum-config.js beings with a less than sign (<) for its <script> tag.

Any ideas on what I am missing?  Am I using Substitute wrong?  Is there another option I am missing for Apache?  

Labels (1)
0 Karma

Luis_Sánchez
Explorer

Hi David,

May be a matter of gzip compressing the channel (or something else). I'm sharing my working config:

<Location /daytrader>
SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|<head.*>|<head$1><script>window['adrum-app-key'] = 'XX-YYY-ZZZ-AAA';window['adrum-start-time'] = new Date().getTime();</script><script src=\"/appdyn/adrum/adrum-config.js\"></script>|iq"
</Location>

Hope it helps, regards,

Luis

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi,

I was able to get this working with Chrome, but for some reason ie11 does not work in Confluence if I put your lines in place.  I think it Is somehow related to caching.  To get IE11 working with confluence again, I had to comment out your lines and then clear cache in IE11 with the Preserve Favorites website data

Unchecked.  Otherwise, I keep seeing the substitute lines and it continues to not work.

 

I need some ideas on how to get this working then with IE11.

 

David

0 Karma

Luis_Sánchez
Explorer

Please share:

  • HTML source code of <head> tag without substitution
  • HTML source code after substitution

Thank you,

Luis

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Unlocking Unified Insights: New Gigamon Federated Search App for Splunk

In today’s data-heavy environment, organizations are caught in a data distribution dilemma. As data volumes ...

GA: New Data Management App in Splunk Platform

Streamlining Data Management: Introducing a unified experience in Splunk Managing data at scale shouldn’t feel ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...