• Forums
    • Public Forums
      • Community Connect
      • Dynatrace
        • Dynatrace Open Q&A
      • Application Monitoring & UEM
        • AppMon & UEM Open Q&A
      • Network Application Monitoring
        • NAM Open Q&A
        • Enterprise Synthetic Monitoring
      • Synthetic Classic
        • Synthetic Classic Open Q&A
  • Home /
  • Public Forums /
  • Dynatrace /
  • Dynatrace Open Q&A /
avatar image
Question by Alexander R. · Oct 01 at 07:53 AM · uem RUM

User tag - Not supported JavaScript expression

Hello community.

I can`t add JavaScript variable in user tag rule with message "Not supported JavaScript expression"


Why i can`t use JS variables from local storage?

I have no cookies, CSS selector with username. I have only this JS value. Is there any workaround without JS dtrum sdk with dtrum.identify.... to use this value?


Regards,

Alexander

1569915644667.png (27.5 kB)
Comment

People who like this

0 Show 2
10 |2000000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

avatar image Janusz D. · Oct 01 at 08:22 AM 0
Share

With google you can easily search for how to list all global JS variables in Chrome console.
eg. you can run

for(var b in window) {

if(window.hasOwnProperty(b)) console.log(b);

}

as page below sugggest
https://stackoverflow.com/questions/2934787/view-list-of-all-javascript-variables-in-google-chrome-console

Then use the value you need in Dynatrace
Please mind only global variables are accessible.

avatar image Alexander R. Janusz D. · Oct 01 at 08:34 AM 0
Share

Hello Janusz,


My question is not "HOW". My question is "WHY it is not possible to use this value"

I use this:

(function ()

{

var keys=Object.keys( window );

for (var i in keys)

{

if (typeof window[keys[i]] != 'function')

console.log(keys[i], window[keys[i]]);

}

})();


I have see this value and can call from web browser console. After cleanup rules (cut usernames and symbols (.:") i will have correct login.


Regards,

Alexander

2 Replies

  • Sort: 
  • Most voted
  • Newest
  • Oldest
avatar image
Best Answer

Answer by Janusz D. · Oct 01 at 12:53 PM

So explanation.
Variable name contained dash so in Chrome console - format as below

localStorage.__Sxxe-Sxxxxxx-RxxxxxxService_Sxxx_Sxxxxx_RxxxxxxyService

did not work

in Chrome console - format as below

localStorage["__Sxxe-Sxxxxxx-RxxxxxxService_Sxxx_Sxxxxx_RxxxxxxyService"]

returned requested value.

Fortunatelly syntax

localStorage.__Sxxe-Sxxxxxx-RxxxxxxService_Sxxx_Sxxxxx_RxxxxxxyService 

worked in Dynatrace despite dashes.

Comment

People who like this

0 Show 1 · Share
10 |2000000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

avatar image Alexander R. · Oct 01 at 12:55 PM 0
Share

Janusz provided me solution as:

In browser console the call executed with error but in Dynatrace we have successfully defined userlogins.

Big thanks to Janusz.

Regards,

Alexander

1569934199574.png (14.5 kB)
avatar image

Answer by Alexander S. · Oct 01 at 08:31 AM

Have you tried: localStorage.<variableName>?

Comment

People who like this

0 Show 1 · Share
10 |2000000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

avatar image Alexander R. · Oct 01 at 09:31 AM 0
Share

Hello Alexander

I can`t call localStorage.<variableName>, but i can cal localStorage["some"] - 2 string on screenshot.

You can see localStorage call in browser console on screenshot below:

Can i use localStorage variable with cleanup rules? Will it works?


Regards,

Alexander

1569922044786.png (18.9 kB)

Join the conversation!

First steps in the forum
Community User Guide

LIVE WEBINAR

"Power Demo: Software Intelligence for Cloud Infrastructure"


DECEMBER 12, 10:00 AM GMT / 2:00 PM ET

Register here

Live webinar: Ensuring Digital Business Availability with Dynatrace

Learn how Dynatrace Real User Monitoring automatically detects errors that impact your end users caused by erroneous 3rd party or CDNs.
December 10, 4:00 pm CET / 10:00 am ET
Register here

Live webinar: Ensuring Digital Business Availability with Dynatrace

Learn how Dynatrace Real User Monitoring automatically detects errors that impact your end users caused by erroneous 3rd party or CDNs.
December 10, 4:00 pm CET / 10:00 am ET
Register here

Live webinar: Ensuring Digital Business Availability with Dynatrace

Learn how Dynatrace Real User Monitoring automatically detects errors that impact your end users caused by erroneous 3rd party or CDNs.
December 10, 4:00 pm CET / 10:00 am ET
Register here

Follow this Question

Answers Answers and Comments

34 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

offtopic - Dynatrace is Gartner APM 2019 leader 2 Answers

Trying to do RUM injection but receiving an odd response from the 'rb' POST 1 Answer

Is there time line for USQL to support where with regular expressions or LIKE? 1 Answer

Limit on data sent through POST call to Dynatrace Server by RUM JavaScript 0 Answers

​Is the cookie of RUM saved for each domain? And Is there any related settings? 2 Answers

Forum Tags

mobile monitoring dotnet iis chat kubernetes servicenow amazon web services mysql rest api cassandra dashboard oneagent sdk cmc application monitoring smartscape request attributes monitoring ui developer community user tagging log monitoring services ufo activegate auto-detection high five award webserver uem test automation license web performance monitoring ios migration management zones web services sso notifications host monitoring reports browser monitors java sap vmware maintenance window javascript appmon ai availability tipstricks automation extensions session replay permissions faq documentation problem detection http monitors easytravel network docker tags and metadata cloud foundry google cloud platform synthetic monitoring process groups account usability dynatrace saas gui paas openshift key user actions administration hosts user actions postgresql synthetic locations oneagent security Dynatrace Managed user management python technologies mongodb openstack user session monitoring continuous delivery citrix configuration alerting NGINX action naming linux nam installation database mission control apache mobileapp RUM php azure purepath davis plugins scripting aix nodejs android
  • Forums
  • Public Forums
    • Community Connect
    • Dynatrace
      • Dynatrace Open Q&A
    • Application Monitoring & UEM
      • AppMon & UEM Open Q&A
    • Network Application Monitoring
      • NAM Open Q&A
      • Enterprise Synthetic Monitoring
    • Synthetic Classic
      • Synthetic Classic Open Q&A