You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/search/optimize-search-performance.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,21 +96,21 @@ sourceCategory=foo and field_a=value_a
96
96
97
97
### Move terms from parse statement to source expression
98
98
99
-
Adding the parsing terms in the source expression will help you enhance the search performance. A parse statement without `nodrop` drops the logs that could not parse the desired field. For example, `parse “completed * action“ as actionName` will remove logs that do not have **completed** and **action** terms.
99
+
Adding the parsing terms in the source expression will help you enhance the search performance. A parse statement without `nodrop` drops the logs that could not parse the desired field. For example, `parse "completed * action" as actionName` will remove logs that do not have **completed** and **action** terms.
| parse “completed * action in * ms“ as actionName, duration
236
-
| where actionName in (“login”, “logout”)
235
+
| parse "completed * action in * ms" as actionName, duration
236
+
| where actionName in ("login”, "logout”)
237
237
| lookup actionType from path://"/Library/Users/[email protected]/actionTypes" on actionName
238
238
| count by actionName, actionType
239
239
```
@@ -246,15 +246,15 @@ For example, consider the below query where the assumption is that a single log
246
246
247
247
```
248
248
_sourceCategory=Prod/User/Eventlog
249
-
| parse regex “userName: (?<user>[a-z-A-Z]+), “ multi
250
-
| parse regex “eventName: (?<event>[a-z-A-Z]+), “ multi
249
+
| parse regex "userName: (?<user>[a-z-A-Z]+), " multi
250
+
| parse regex "eventName: (?<event>[a-z-A-Z]+), " multi
251
251
```
252
252
253
253
But if you write the query like that, it will generate a result for every combination of `userName` and `eventName` values. Now suppose you want to count by `eventName`, it will not give you the desired result, since a single `eventName` has been duplicated for every `userName` in the same log. So, the better query would be:
254
254
255
255
```
256
256
_sourceCategory=Prod/User/Eventlog
257
-
| parse regex “userName: (?<user>[a-z-A-Z]+), eventName: (?<event>[a-z-A-Z]+), “ multi
257
+
| parse regex "userName: (?<user>[a-z-A-Z]+), eventName: (?<event>[a-z-A-Z]+), " multi
0 commit comments