• 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
  • Home /
  • Public Forums /
  • Application Monitoring & UEM /
  • AppMon & UEM Open Q&A /
avatar image
Question by Sharyl K. · Aug 08, 2014 at 01:59 AM ·

Extract user name from cookie

How can I do regex to get a106529 in this sample - string part of cookie? cookie name = ALN.ps.cache.key, then how should I do in regex rule to get "a106529" when I set up split measure for business transaction?

ALN.ps.cache.key=0AC23617-49AB-DE11-0147-81CF98938554|a106529|;

Comment

People who like this

0 Show 0
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

3 Replies

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

Answer by Rick B. · Aug 28, 2014 at 06:33 AM

This should work:

ALN.ps.cache.key=[^|]*\|([^|]*)

 

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
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image Sharyl K. · Aug 28, 2014 at 06:51 AM 0
Share

Thank you very much!!!

avatar image

Answer by Rob V. · Aug 08, 2014 at 01:50 PM

Hi Sharyl,

No, the "?" isn't specific to dT. It's a "non-greedy" read in regex language. The backslash "\" is the escape character. The regex gets read this way:

  • .?\|   this means to "non-greedy" read to the first vertical bar "|". It's like .*\|, but .*\| will aggressively read to to the last vertical bar
  • the ([^\|]*) will read up to the next vertical bar, and put that result into the return group. That's how we get the result.

Here's a screen shot of the "transformation regex" testing tool in dynaTrace showing the result:

Rob

 

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
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image Sharyl K. · Aug 28, 2014 at 06:21 AM 0
Share

Rob,

I think I have to split from header value. following are cookie string under request header. So I think I should use split by Header Value and Header Field = coookie. Now I have to work on new regex. Can you help?

User id is snvjjy03 from ALN.ps.cache.key=0A54D951-206B-DB59-0148-13C2FD6ADC75|snvjjy03|; in following header

AG-HS-PD-H-SESSION-ID=4_Fj6XA2CzmW1KyHmi91GvWeh0ntyQQgUKCUAWyZMDoReptKP0; BIGipServeragency-tam-primary-gl-443-pool=552736684.47873.0000; BIGipServeragency-tam-primary-ro-443-pool=635180716.47873.0000; dtCookie=9881DE4FC287DCA66EF85C70DB99930F|_default|1|eAgent|1; dtPC=585262618_830#Generic%20XHR; dtLatC=208|176.5|184.5|153.5|170|176|167|169|395|321.5|168; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3Dallstatetam%253D%252526pid%25253DGateway-Splash%252526pidt%25253D1%252526oid%25253Dhttps%2525253A%25252F%25252Fagencygateway2.allstate.com%25252FALLIANCE%25252Flaunch%25252F%2525253FSourceOfLaunchPoint%2525253D02%252526ot%25253DA%252526oi%25253D22%3B; BIGipServeragentsupport2-primary-443-pool=702289580.47873.0000; BIGipServereagent2-primary-443-pool=635180716.47873.0000; DCCD=dc2; USER_GEO_ID=TXG0201; s_vi=[CS]v1|29FF0111851D025F-4000010BC0000670[CE]; s_pers=%20gpv_pn%3D%252Faccessallstate%252Fanon%252Flogin.aspx%7C1409165780319%3B%20s_getNewRepeat%3D1409163980325-Repeat%7C1411755980325%3B; atgPlatoStop=1; LtpaToken2=34bst72C/hJNN603wBo0sWHyOGFMztZspmM/KyNEcxnvOvwe1aWMsQymY5o1TUkBmC4d42XtoEWaoPV9ioJj9XuTmw6Y1zLI87jPweav3DjKybWHoRHm5ZJhFvPYUi5+PNAHjDJlrxabW7TCwMm1weQB+CD7+xwJbYAOU4ggkjeQ+qy+nup5eBg6VIRcvsFY/CNBn0NT9g5x6eL+/x2qezsAu3pUIBls8XESMkNNfaa9lQ8rWrQ3Q+6GfsMO+GdCk1FANUNSU97uOAprNM0Dp5b9OVaSY9gtgiV7SVgdCwX1dVLuuqTTsJJ+mEe/TATqIf+F7OS399/IsQU4YvZKglQMHyOSMTh+3/JU4xFz8Bn8f0OF/K7z/PlxQgVRfTQRfnqkbeF+dWnByg/Ofy8ADqVgIPUUQhfA8fz2+0fGlSMU5MarUqD+hsbeXNdpjfwy3PfEl7Xiv8dTZnphRCud3qK+1IJwz6bfDpyZ/XedmEC2bs3o/EcxQkDcAqO/WZuL; LtpaToken=0KpCtg0Y4cxIXNIHGWy1d1LBN1JeEp5hXunmOd5+8/lnCCoxx+pcytqy4bXZc5TGg2fZORWORvDyLA/GpIdOcgOgDla2eKMpMiXd/qBiveArsosQDPDzXNkePkELqOQ1eyPxfdtkv2W1Fv2QdLbGlET3n1dR1vp5LgAXDdeUSzA7BO/r7qxqvD/oQQox3pIY88erA2zu9nzcs+S8LtfrtZmNX6BFiHc146cRmk99LpK53Gc6Ay8JrAGSujkE07oATmu/cWv2Z4TYhXe5mRZsD54yMPJ6b9uQA5ehHCmNo/Bdp+dz+UION4Rr9nFW+Cme48aMatlQkPMqFRZSpHJMLHu55EsdyCdwull/dNFoKYOdCx81ZyDY4bYq/DelLwk4CrZcoSWO5Ro=;ALN.ps.cache.key=0A54D951-206B-DB59-0148-13C2FD6ADC75|snvjjy03|; xaJSESSIONID=0000IzMvx-sw9aBTR8yMdPT4zRf:16h1943dc; TmznFfst=-420; CP=null*

 

avatar image

Answer by Rob V. · Aug 08, 2014 at 02:08 AM

Hi Sharyl,

For the pattern shown above, the following should work for you:

.?\|([^\|]*)

Rob

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
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image Sharyl K. · Aug 08, 2014 at 01:24 PM 0
Share

Rob,

Thank you very much. I used $ to escap \ so I got result -. Is ? specific for dynaTrace?

 

Sharyl

How to get started

First steps in the forum
Read Community User Guide
Best practices of using forum

NAM 2019 SP5 is available


Check the RHEL support added in the latest NAM service pack.

Learn more

LIVE WEBINAR

"Performance Clinic - Monitoring as a Self Service with Dynatrace"


JANUARY 15, 3:00 PM GMT / 10:00 AM ET

Register here

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Forum Tags

dotnet mobile monitoring load iis 6.5 kubernetes mainframe rest api dashboard framework 7.0 appmon 7 health monitoring adk log monitoring services auto-detection uem webserver test automation license web performance monitoring ios nam probe collector migration mq web services knowledge sharing reports window java hybris javascript appmon sensors good to know extensions search 6.3+ server documentation easytravel web dashboard kibana system profile purelytics docker splunk 6.1 process groups account 7.2 rest dynatrace saas spa guardian appmon administration production user actions postgresql upgrade oneagent measures security Dynatrace Managed transactionflow technologies diagnostics user session monitoring unique users continuous delivery sharing configuration alerting NGINX splitting business transaction client 6.3 installation database scheduler apache mobileapp RUM php dashlet azure purepath agent 7.1 appmonsaas messagebroker nodejs 6.2 android sensor performance warehouse
  • 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