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/victorialogs/logsql.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4532,6 +4532,11 @@ over logs for the last 5 minutes:
4532
4532
_time:5m | stats max(duration) max_duration
4533
4533
```
4534
4534
4535
+
The `max(some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4536
+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4537
+
Use `max(some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4538
+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4539
+
4535
4540
It is possible to calculate the maximum value across all the fields with common prefix via `max(prefix*)` syntax.
4536
4541
4537
4542
[`row_max`](https://docs.victoriametrics.com/victorialogs/logsql/#row_max-stats) function can be used for obtaining other fields with the maximum duration.
@@ -4555,6 +4560,11 @@ over logs for the last 5 minutes:
4555
4560
_time:5m | stats median(duration) median_duration
4556
4561
```
4557
4562
4563
+
The `median(some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4564
+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4565
+
Use `median(some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4566
+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4567
+
4558
4568
It is possible to calculate the median across all the fields with common prefix via `median(prefix*)` syntax.
4559
4569
4560
4570
See also:
@@ -4574,6 +4584,11 @@ over logs for the last 5 minutes:
4574
4584
_time:5m | stats min(duration) min_duration
4575
4585
```
4576
4586
4587
+
The `min(some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4588
+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4589
+
Use `min(some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4590
+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4591
+
4577
4592
It is possible to find the minimum across all the fields with common prefix via `min(prefix*)` syntax.
4578
4593
4579
4594
[`row_min`](https://docs.victoriametrics.com/victorialogs/logsql/#row_min-stats) function can be used for obtaining other fields with the minimum duration.
@@ -4601,6 +4616,11 @@ _time:5m | stats
4601
4616
quantile(0.99, request_duration_seconds) p99
4602
4617
```
4603
4618
4619
+
The `quantile(phi, some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4620
+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4621
+
Use `quantile(phi, some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4622
+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4623
+
4604
4624
It is possible to calculate the quantile across all the fields with common prefix via `quantile(phi, prefix*)` syntax.
0 commit comments