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
* function: mandatory. An aggregation function or window function.
46
+
* bucket_nullable: optional. Controls whether the eventstats command consider null buckets as a valid group in group-by aggregations. When set to ``false``, it will not treat null group-by values as a distinct group during aggregation. **Default:** Determined by ``plugins.ppl.syntax.legacy.preferred``.
47
+
48
+
* When ``plugins.ppl.syntax.legacy.preferred=true``, ``bucket_nullable`` defaults to ``true``
49
+
* When ``plugins.ppl.syntax.legacy.preferred=false``, ``bucket_nullable`` defaults to ``false``
50
+
46
51
* by-clause: optional. Groups results by specified fields or expressions. Syntax: by [span-expression,] [field,]... **Default:** aggregation over the entire result set.
47
52
* span-expression: optional, at most one. Splits field into buckets by intervals. Syntax: span(field_expr, interval_expr). For example, ``span(age, 10)`` creates 10-year age buckets, ``span(timestamp, 1h)`` creates hourly buckets.
48
53
@@ -126,3 +131,32 @@ PPL query::
126
131
| 13 | F | 28 | 1 |
127
132
| 18 | M | 33 | 2 |
128
133
+----------------+--------+-----+-----+
134
+
135
+
Example 3: Null buckets handling
136
+
================================
137
+
138
+
PPL query::
139
+
140
+
os> source=accounts | eventstats bucket_nullable=false count() as cnt by employer | fields account_number, firstname, employer, cnt | sort account_number;
141
+
fetched rows / total rows = 4/4
142
+
+----------------+-----------+----------+------+
143
+
| account_number | firstname | employer | cnt |
144
+
|----------------+-----------+----------+------|
145
+
| 1 | Amber | Pyrami | 1 |
146
+
| 6 | Hattie | Netagy | 1 |
147
+
| 13 | Nanette | Quility | 1 |
148
+
| 18 | Dale | null | null |
149
+
+----------------+-----------+----------+------+
150
+
151
+
PPL query::
152
+
153
+
os> source=accounts | eventstats bucket_nullable=true count() as cnt by employer | fields account_number, firstname, employer, cnt | sort account_number;
0 commit comments