|
| 1 | +--- |
| 2 | +title: "RUM Data Query Syntax Guide" |
| 3 | +description: "Master the search syntax of Flashduty RUM Session Explorer to quickly locate and analyze user data through flexible query conditions." |
| 4 | +date: "2024-05-09T10:00:00+08:00" |
| 5 | +url: "https://docs.flashcat.cloud/en/flashduty/rum/session-explorer-data-query" |
| 6 | +--- |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +Flashduty RUM Session Explorer provides powerful search capabilities, allowing you to quickly locate and analyze RUM data through flexible query syntax. Queries consist of **terms** and **operators**, supporting complex search condition combinations to help you accurately find the information you need from massive data. |
| 11 | + |
| 12 | +The query supports two types of terms: |
| 13 | + |
| 14 | +1. **Single term**: A single word, such as `test` or `hello` |
| 15 | +2. **Phrase**: A group of words surrounded by double quotes, such as `"hello flashduty"` |
| 16 | + |
| 17 | +You can use the following boolean operators to combine multiple terms to build complex queries: |
| 18 | + |
| 19 | +| Operator | Description | Example | |
| 20 | +| -------- | ------------------------------------------------------------------- | -------------------- | |
| 21 | +| `AND` | Intersection: both terms must be in the selected view (default) | `error AND timeout` | |
| 22 | +| `OR` | Union: either term is contained in the selected view, must use `()` | `(error OR warning)` | |
| 23 | +| `-` | Exclusion: the following term is not in the view | `error -timeout` | |
| 24 | + |
| 25 | +## Full-Text Search |
| 26 | + |
| 27 | +:::highlight orange 💡 |
| 28 | +Full-text search is only supported for some fields. If no results are found, please switch to field queries. |
| 29 | +::: |
| 30 | + |
| 31 | +You can quickly query data through full-text search: |
| 32 | + |
| 33 | +| Query Statement | Description | |
| 34 | +| --------------- | ------------------------------------------------- | |
| 35 | +| hello | Exact match for fields containing `hello` | |
| 36 | +| hello\* | Match fields starting with `hello` | |
| 37 | +| \*hello | Match fields ending with `hello` | |
| 38 | +| \*hello\* | Match fields containing `hello` | |
| 39 | +| "hello world" | Exact match for fields containing `"hello world"` | |
| 40 | + |
| 41 | +## Escaping Special Characters and Spaces |
| 42 | + |
| 43 | +When searching for field values containing special characters, you need to use backslash `\` escaping or double quotes. The following characters are considered special: `:`, `"`, `*`, `-`, `>`, `<`, `,`, `(`, `)`, `[`, `]`, `\` and space. |
| 44 | + |
| 45 | +## Attribute Search |
| 46 | + |
| 47 | +You can use `attribute:term` to search for specific attributes: |
| 48 | + |
| 49 | +| Query Statement | Description | |
| 50 | +| :---------------------- | --------------------------------------------- | |
| 51 | +| browser_name:Chrome | Search for browsers with value `Chrome` | |
| 52 | +| view_name:\*/detail | Search for view names ending with `/detail` | |
| 53 | +| -resource_status_code:0 | Search for resources with status code not `0` | |
| 54 | +| os_name:"Mac OS X" | Search for OS name with value `"Mac OS X"` | |
| 55 | + |
| 56 | +## Numeric Search |
| 57 | + |
| 58 | +For numeric type attributes, we can use comparison operators `>` `>=` `<` `<=` for searching: |
| 59 | + |
| 60 | +| Query Statement | Description | |
| 61 | +| :-------------------------- | ------------------------------------------------------- | |
| 62 | +| session_error_count:>5 | Search for sessions with error count greater than `5` | |
| 63 | +| view_time_spent:>=1.00min | Search for views with time spent greater than `1min` | |
| 64 | +| session_view_count:[2 TO 8] | Search for sessions with view count between `2` and `8` | |
| 65 | + |
| 66 | +## Complex Search |
| 67 | + |
| 68 | +For complex situations, we can combine any conditions for searching. |
| 69 | + |
| 70 | +### Error Analysis Search |
| 71 | + |
| 72 | +``` |
| 73 | +error_message:Warning\:* view_url_path:/wallet/* |
| 74 | +``` |
| 75 | + |
| 76 | +Search for Warning type errors occurring on wallet pages. |
| 77 | + |
| 78 | +### Performance Analysis Search |
| 79 | + |
| 80 | +``` |
| 81 | +view_loading_time:>=5s view_url_path:/incident/detail/* |
| 82 | +``` |
| 83 | + |
| 84 | +Search for views with loading time exceeding 5 seconds and starting with `/incident/detail/`. |
| 85 | + |
| 86 | +### Failed Request Analysis |
| 87 | + |
| 88 | +``` |
| 89 | +-resource_status_code:200 resource_type:(fetch OR xhr) |
| 90 | +``` |
| 91 | + |
| 92 | +Search for resources with request type `fetch` or `xhr` and status code not `200`. |
| 93 | + |
| 94 | +### Page Behavior Analysis |
| 95 | + |
| 96 | +``` |
| 97 | +view_url_path:/incident (view_action_count:>=2 OR view_error_count:>=3) |
| 98 | +``` |
| 99 | + |
| 100 | +Search for views with URL `/incident` and action count greater than `2` or error count greater than `3`. |
| 101 | + |
| 102 | +## Advanced Search Tips |
| 103 | + |
| 104 | +### 1. Time Range Search |
| 105 | + |
| 106 | +Combine time ranges for precise searching: |
| 107 | + |
| 108 | +``` |
| 109 | +view_loading_time:>2s client_time:>1758253826081 |
| 110 | +``` |
| 111 | + |
| 112 | +### 2. User Behavior Search |
| 113 | + |
| 114 | +``` |
| 115 | +action_type:click view_url_path:/checkout/* |
| 116 | +``` |
| 117 | + |
| 118 | +Search for user click behaviors on checkout pages. |
| 119 | + |
| 120 | +### 3. Device Type Search |
| 121 | + |
| 122 | +``` |
| 123 | +device_type:mobile view_loading_time:>3s |
| 124 | +``` |
| 125 | + |
| 126 | +Search for views on mobile devices with loading time exceeding 3 seconds. |
| 127 | + |
| 128 | +### 4. Geographic Location Search |
| 129 | + |
| 130 | +``` |
| 131 | +geo_country:China session_error_count:>0 |
| 132 | +``` |
| 133 | + |
| 134 | +Search for sessions with errors in China. |
| 135 | + |
| 136 | +## Best Practices |
| 137 | + |
| 138 | +1. **Use quotes for phrases**: Ensure exact matching of multi-word phrases |
| 139 | +2. **Use wildcards reasonably**: Avoid overly broad search conditions |
| 140 | +3. **Combine multiple conditions**: Build precise queries through AND/OR operators |
| 141 | +4. **Save common searches**: Improve efficiency of repeated queries |
| 142 | +5. **Utilize auto-completion**: Reduce input errors and improve search accuracy |
| 143 | + |
| 144 | +## Next Steps |
| 145 | + |
| 146 | +- [RUM Session Explorer Overview](https://docs.flashcat.cloud/en/flashduty/rum/rum-explorer) |
| 147 | +- [Distributed Tracing Best Practices](https://docs.flashcat.cloud/en/flashduty/rum/distributed-tracing) |
0 commit comments