File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,19 @@ In a query you start by getting events from a bucket and assign that collection
25
25
After that you assign what you want to receive from the request to the RETURN variable.
26
26
27
27
Magic Variables:
28
-
29
28
There is a magic variable `__CATEGORIES__ ` you can use in the web UI's Query Explorer to include your configured categories in your query.
30
29
31
- Here's an example of using this variable to find all events categorized as "Work "
30
+ Here's an example of using this variable to find all events categorized as "Web Browsing "
32
31
33
32
.. code-block :: python
34
33
35
- events = flood(query_bucket(" aw-watcher-window_" ));
36
- not_afk = flood(query_bucket(" aw-watcher-afk_" ));
34
+ events = flood(query_bucket(find_bucket( " aw-watcher-window_" ) ));
35
+ not_afk = flood(query_bucket(find_bucket( " aw-watcher-afk_" ) ));
37
36
not_afk = filter_keyvals(not_afk, " status" , [" not-afk" ]);
38
37
events = filter_period_intersect(events, not_afk);
39
38
events = categorize(events, __CATEGORIES__ );
40
39
events = filter_keyvals(events, " $category" , [[" Work" ]]);
41
- RETURN = events;
40
+ RETURN = sort_by_duration( events) ;
42
41
43
42
Minimal example:
44
43
Minimal query which only gets events from a bucket and returns it:
You can’t perform that action at this time.
0 commit comments