cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Count user sessions in USQL: array object contains only X

william_cher
Participant

Given response_code column :

 

 

 

 

 

[, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 200, 200, , , , 200, 200, 402, , , , , , , , , , , , , , , , , , , , , , , , 200, 200, , , , 200, 200, 402, , , , , ] , [, , , , , , , , , , , , , , , , , , , , , , , , 200, 200, , , , 200, 200, 200, , , , 200, , , , , , ], ... 

 

 

 

 

 

What's the most optimized USQL to count this where the array object contain only 200. For eg, Array object that contain 200 and 201 will not be counted.

I've used this :

 

 

 

 

 

WHERE useraction.stringProperties.response_code = "200"

 

 

 

 

 

 It matches array object contain 200 and also other response. A not so elegant way is to create all condition that exlude response_code other than 200 like

 

 

 

 

 

WHERE NOT (useraction.stringProperties.response_codes LIKE "3*") AND NOT (...)

 

 

 

 

 

This would create so many rules that you can't create a custom metric with it.

 

1 REPLY 1

Ana_Kuzmenchuk
Community Team
Community Team

Hi @william_cher , were you able to solve your issue in the meantime? 

If not yet, maybe this doc can be an inspiration while the Community comes forward to help you out!

The only constant is change. Finding ways for great things to happen!

Featured Posts