Skip to content

Commit b195e94

Browse files
authored
Merge pull request #52 from VictoriaMetrics-Community/docs-update-2025-12-15
updated embedded docs and blog posts
2 parents ab7e39a + 4ecdbb7 commit b195e94

File tree

10 files changed

+351
-129
lines changed

10 files changed

+351
-129
lines changed

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/CHANGELOG.md

Lines changed: 146 additions & 109 deletions
Large diffs are not rendered by default.

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/FAQ.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,37 @@ or [Grafana plugin for VictoriaLogs](https://docs.victoriametrics.com/victorialo
243243
then make sure the selected time range covers the last day. Otherwise, the query above returns
244244
results on the intersection of the last day and the selected time range.
245245

246-
See [why the log field occupies a lot of disk space](https://docs.victoriametrics.com/victorialogs/faq/#why-the-log-field-occupies-a-lot-of-disk-space).
246+
See also:
247+
248+
- [Why the log field occupies a lot of disk space](https://docs.victoriametrics.com/victorialogs/faq/#why-the-log-field-occupies-a-lot-of-disk-space).
249+
- [How to detect log streams, which occupy the most of disk space](https://docs.victoriametrics.com/victorialogs/faq/#how-to-determine-which-log-streams-occupy-the-most-of-disk-space).
250+
251+
## How to determine which log streams occupy the most of disk space?
252+
253+
[Run](https://docs.victoriametrics.com/victorialogs/querying/) the following [LogsQL](https://docs.victoriametrics.com/victorialogs/logsql/) query
254+
based on [`block_stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#block_stats-pipe):
255+
256+
```logsql
257+
_time:1d
258+
| block_stats
259+
| stats by (_stream)
260+
sum(values_bytes) as values_bytes,
261+
sum(bloom_bytes) as bloom_bytes
262+
| math
263+
(values_bytes+bloom_bytes) as total_bytes
264+
| first 10 (total_bytes desc)
265+
```
266+
267+
This query returns top 10 [log streams](https://docs.victoriametrics.com/victorialogs/keyconcepts/#stream-fields),
268+
which occupy the most of disk space across the logs ingested during the last day. The occupied disk space
269+
is returned in the `total_bytes` field.
270+
271+
If you use [VictoriaLogs web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui)
272+
or [Grafana plugin for VictoriaLogs](https://docs.victoriametrics.com/victorialogs/integrations/grafana/),
273+
then make sure the selected time range covers the last day. Otherwise, the query above returns
274+
results on the intersection of the last day and the selected time range.
275+
276+
See also [how to detect log fields, which occupy the most of disk space](https://docs.victoriametrics.com/victorialogs/faq/#how-to-determine-which-log-fields-occupy-the-most-of-disk-space).
247277

248278
## Why the log field occupies a lot of disk space?
249279

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/LogsQL.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,8 @@ LogsQL supports the following pipes:
16661666

16671667
### block_stats pipe
16681668

1669-
`<q> | block_stats` [pipe](https://docs.victoriametrics.com/victorialogs/logsql/#pipes) returns the following stats for each block processed by `<q>` [query](https://docs.victoriametrics.com/victorialogs/logsql/#query-syntax):
1669+
`<q> | block_stats` [pipe](https://docs.victoriametrics.com/victorialogs/logsql/#pipes) returns the following stats for each field in every data block
1670+
processed by `<q>` [query](https://docs.victoriametrics.com/victorialogs/logsql/#query-syntax):
16701671

16711672
- `field` - [field](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model) name
16721673
- `rows` - the number of rows at the given `field`
@@ -1675,9 +1676,12 @@ LogsQL supports the following pipes:
16751676
- `bloom_bytes` - on-disk size of bloom filter data for the given `field`
16761677
- `dict_bytes` - on-disk size of the dictionary data for the given `field`
16771678
- `dict_items` - the number of unique values in the dictionary for the given `field`
1678-
- `part_path` - the path to the data part where the block is stored
1679+
- `_stream` - the [log stream](https://docs.victoriametrics.com/victorialogs/keyconcepts/#stream-fields) for the given `field`
1680+
- `part_path` - the path to the data part where the field data is stored
16791681

16801682
The `block_stats` pipe is needed mostly for debugging purposes.
1683+
See, for example, [how to detect which log field occupies the most of the disk space](https://docs.victoriametrics.com/victorialogs/faq/#how-to-determine-which-log-fields-occupy-the-most-of-disk-space),
1684+
or [how to detect which log stream occupies the most of the disk space](https://docs.victoriametrics.com/victorialogs/faq/#how-to-determine-which-log-streams-occupy-the-most-of-disk-space).
16811685

16821686
See also:
16831687

@@ -4532,6 +4536,11 @@ over logs for the last 5 minutes:
45324536
_time:5m | stats max(duration) max_duration
45334537
```
45344538

4539+
The `max(some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4540+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4541+
Use `max(some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4542+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4543+
45354544
It is possible to calculate the maximum value across all the fields with common prefix via `max(prefix*)` syntax.
45364545

45374546
[`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 +4564,11 @@ over logs for the last 5 minutes:
45554564
_time:5m | stats median(duration) median_duration
45564565
```
45574566

4567+
The `median(some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4568+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4569+
Use `median(some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4570+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4571+
45584572
It is possible to calculate the median across all the fields with common prefix via `median(prefix*)` syntax.
45594573

45604574
See also:
@@ -4574,6 +4588,11 @@ over logs for the last 5 minutes:
45744588
_time:5m | stats min(duration) min_duration
45754589
```
45764590

4591+
The `min(some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4592+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4593+
Use `min(some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4594+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4595+
45774596
It is possible to find the minimum across all the fields with common prefix via `min(prefix*)` syntax.
45784597

45794598
[`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 +4620,11 @@ _time:5m | stats
46014620
quantile(0.99, request_duration_seconds) p99
46024621
```
46034622

4623+
The `quantile(phi, some_field)` function works with string values for the `some_field`, so it returns an empty string value if `some_field`
4624+
is missing in some of the processed logs according to [VictoriaLogs data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
4625+
Use `quantile(phi, some_field) if (some_field:*) as min_value_without_empty_string` syntax for filtering out empty string values.
4626+
See [conditional stats docs](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) for more details.
4627+
46044628
It is possible to calculate the quantile across all the fields with common prefix via `quantile(phi, prefix*)` syntax.
46054629

46064630
See also:

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/QuickStart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Just download the archive for the needed operating system and architecture, unpa
3737
For example, the following commands download VictoriaLogs archive for Linux/amd64, unpack and run it:
3838

3939
```sh
40-
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.38.0/victoria-logs-linux-amd64-v1.38.0.tar.gz
41-
tar xzf victoria-logs-linux-amd64-v1.38.0.tar.gz
40+
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.41.0/victoria-logs-linux-amd64-v1.41.0.tar.gz
41+
tar xzf victoria-logs-linux-amd64-v1.41.0.tar.gz
4242
./victoria-logs-prod -storageDataPath=victoria-logs-data
4343
```
4444

@@ -61,7 +61,7 @@ Here is the command to run VictoriaLogs in a Docker container:
6161

6262
```sh
6363
docker run --rm -it -p 9428:9428 -v ./victoria-logs-data:/victoria-logs-data \
64-
docker.io/victoriametrics/victoria-logs:v1.38.0 -storageDataPath=victoria-logs-data
64+
docker.io/victoriametrics/victoria-logs:v1.41.0 -storageDataPath=victoria-logs-data
6565
```
6666

6767
See also:

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ to [Grafana plugin playground for VictoriaLogs](https://play-grafana.victoriamet
6060
The only option is increasing the limit on [the number of open files in the OS](https://medium.com/@muhammadtriwibowo/set-permanently-ulimit-n-open-files-in-ubuntu-4d61064429a).
6161
- The recommended filesystem is `ext4`, the recommended persistent storage is [persistent HDD-based disk on GCP](https://cloud.google.com/compute/docs/disks/#pdspecs),
6262
since it is protected from hardware failures via internal replication and it can be [resized on the fly](https://cloud.google.com/compute/docs/disks/add-persistent-disk#resize_pd).
63-
If you plan to store more than 1TB of data on `ext4` partition or plan extending it to more than 16TB,
64-
then the following options are recommended to pass to `mkfs.ext4`:
63+
If you plan to store more than 1TB of data on `ext4` partition, then the following options are recommended to pass to `mkfs.ext4`:
6564

6665
```sh
6766
mkfs.ext4 ... -O 64bit,huge_file,extent -T huge
@@ -195,6 +194,11 @@ VictoriaLogs accepts logs with timestamps in the time range `[now-retentionPerio
195194
where `retentionPeriod` is the value for the `-retentionPeriod` command-line flag and `futureRetention` is the value for the `-futureRetention` command-line flag.
196195
Sometimes it is needed to reject logs older than the given age. This can be achieved by passing `-maxBackfillAge=d` command-line flag to VictoriaLogs,
197196
where `d` is the maximum age of logs to be accepted. Older logs are rejected and a sample of these logs is put into VictoriaLogs output logs, so they could be investigated.
197+
For example, the following command starts VictoriaLogs, which rejects logs older than 1 hour:
198+
199+
```sh
200+
/path/to/victoria-logs -maxBackfillAge=1h
201+
```
198202

199203
## Storage
200204

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/cluster.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ If you want running VictoriaLogs cluster in Kubernetes, then please read [these
352352
Download and unpack the latest VictoriaLogs release:
353353

354354
```sh
355-
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.38.0/victoria-logs-linux-amd64-v1.38.0.tar.gz
356-
tar xzf victoria-logs-linux-amd64-v1.38.0.tar.gz
355+
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.41.0/victoria-logs-linux-amd64-v1.41.0.tar.gz
356+
tar xzf victoria-logs-linux-amd64-v1.41.0.tar.gz
357357
```
358358

359359
Start the first [`vlstorage` node](https://docs.victoriametrics.com/victorialogs/cluster/#architecture), which accepts incoming requests at the port `9491` and stores the ingested logs in the `victoria-logs-data-1` directory:

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/querying/README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,17 @@ VictoriaLogs provides `/select/logsql/stats_query?query=<query>&time=<t>` HTTP e
452452
for the given [`query`](https://docs.victoriametrics.com/victorialogs/logsql/) at the given timestamp `t`
453453
in the format compatible with [Prometheus querying API](https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries).
454454

455+
The `<t>` arg can contain values in [any supported format](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#timestamp-formats).
456+
If `<t>` is missing, then it equals to the current time.
457+
455458
The `<query>` must contain [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe). The calculated stats is converted into metrics
456459
with labels from `by(...)` clause of the `| stats by(...)` pipe.
457460

458-
The `<t>` arg can contain values in [any supported format](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#timestamp-formats).
459-
If `<t>` is missing, then it equals to the current time.
461+
The [`row_any`](https://docs.victoriametrics.com/victorialogs/logsql/#row_any-stats), [`row_min`](https://docs.victoriametrics.com/victorialogs/logsql/#row_min-stats)
462+
and [`row_max`](https://docs.victoriametrics.com/victorialogs/logsql/#row_max-stats) stats functions create labels instead of metrics.
463+
464+
Additional labels can be created from metrics via [`format` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#format-pipe).
465+
Additional metrics can be created from the existing metrics via [`math` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#math-pipe).
460466

461467
For example, the following command returns the number of logs per each `level` [field](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model)
462468
across logs over `2024-01-01` day by UTC:
@@ -509,6 +515,7 @@ Below is an example JSON output returned from this endpoint:
509515
```
510516

511517
The `/select/logsql/stats_query` API is useful for generating Prometheus-compatible alerts and calculating recording rules results.
518+
It is used by [vmalert](https://docs.victoriametrics.com/victorialogs/vmalert/).
512519

513520
The `/select/logsql/stats_query` returns the following additional HTTP response headers:
514521

@@ -529,9 +536,6 @@ VictoriaLogs provides `/select/logsql/stats_query_range?query=<query>&start=<sta
529536
for the given [`query`](https://docs.victoriametrics.com/victorialogs/logsql/) on the given `[start ... end)` time range with the given `step` interval.
530537
The stats is returned in the format compatible with [Prometheus querying API](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries).
531538

532-
The `<query>` must contain [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe). The calculated stats is converted into metrics
533-
with labels from `by(...)` clause of the `| stats by(...)` pipe.
534-
535539
The `<start>` and `<end>` args can contain values in [any supported format](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#timestamp-formats).
536540
If `<start>` is missing, then it equals to the minimum timestamp across logs stored in VictoriaLogs.
537541
If `<end>` is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
@@ -543,6 +547,19 @@ Note: The `/select/logsql/stats_query_range` endpoint
543547
relies on `_time` field for time bucketing and therefore does not allow any pipe to change or remove the `_time` before the `| stats ...` pipe.
544548
In contrast, queries passed to [`/select/logsql/stats_query`](https://docs.victoriametrics.com/victorialogs/querying/#querying-log-stats) can include any pipes before the `| stats ...` pipe, including pipes that modify or remove the `_time` field.
545549

550+
The `<query>` must contain [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe). The calculated stats is converted into metrics
551+
with labels from `by(...)` clause of the `| stats by(...)` pipe.
552+
553+
The [`row_any`](https://docs.victoriametrics.com/victorialogs/logsql/#row_any-stats), [`row_min`](https://docs.victoriametrics.com/victorialogs/logsql/#row_min-stats)
554+
and [`row_max`](https://docs.victoriametrics.com/victorialogs/logsql/#row_max-stats) stats functions create labels instead of metrics.
555+
556+
Additional labels can be created from metrics via [`format` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#format-pipe).
557+
Additional metrics can be created from the existing metrics via [`math` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#math-pipe).
558+
559+
It may be useful to use [`running_stats`](https://docs.victoriametrics.com/victorialogs/logsql/#running_stats-pipe)
560+
and [`total_stats`](https://docs.victoriametrics.com/victorialogs/logsql/#total_stats-pipe) pipes for calculating running and total stats over the stats
561+
returned by the [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe).
562+
546563
For example, the following command returns the number of logs per each `level` [field](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model)
547564
across logs over `2024-01-01` day by UTC with 6-hour granularity:
548565

@@ -612,6 +629,7 @@ Below is an example JSON output returned from this endpoint:
612629
```
613630

614631
The `/select/logsql/stats_query_range` API is useful for generating Prometheus-compatible graphs in Grafana.
632+
It is used by [Grafana plugin for VictoriaLogs](https://docs.victoriametrics.com/victorialogs/integrations/grafana/).
615633

616634
The `/select/logsql/stats_query_range` returns the following additional HTTP response headers:
617635

@@ -1098,7 +1116,7 @@ VictoriaLogs provides the following options to limit resource usage by the execu
10981116
## Web UI
10991117

11001118
VictoriaLogs provides Web UI for logs [querying](https://docs.victoriametrics.com/victorialogs/logsql/) and exploration
1101-
at `http://localhost:9428/select/vmui`. Try [VictoriaLogs web UI demo playground](https://play-vmlogs.victoriametrics.com/).
1119+
at `http://localhost:9428/select/vmui/`. Try [VictoriaLogs web UI demo playground](https://play-vmlogs.victoriametrics.com/).
11021120

11031121
There are three modes of displaying query results:
11041122

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/querying/vlogscli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ or from docker images at [Docker Hub](https://hub.docker.com/r/victoriametrics/v
2525
### Running `vlogscli` from release binary
2626

2727
```sh
28-
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.38.0/vlutils-linux-amd64-v1.38.0.tar.gz
29-
tar xzf vlutils-linux-amd64-v1.38.0.tar.gz
28+
curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v1.41.0/vlutils-linux-amd64-v1.41.0.tar.gz
29+
tar xzf vlutils-linux-amd64-v1.41.0.tar.gz
3030
./vlogscli-prod
3131
```
3232

cmd/mcp-victorialogs/resources/vm/docs/victorialogs/security-and-lb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ However, user `admin` needs to set the required `AccountID` or `ProjectID` heade
229229

230230
In Grafana, you need to create a separate data source for each tenant and user, an example of such an address is: `http://vmauth:8427/my-account/mobile-logs`.
231231
Using the configuration above, you do not need to set the tenant in the data source settings because vmauth will set it.
232-
Each tenant will have `vmui` at the address `/select/vmui`, for example: `http://vmauth:8427/my-account/mobile-logs/select/vmui`.
232+
Each tenant will have `vmui` at the address `/select/vmui/`, for example: `http://vmauth:8427/my-account/mobile-logs/select/vmui/`.
233233

234234
If you want to restrict users by only one of the fields `AccountID` or `ProjectID`,
235235
it is enough to not specify the corresponding field in the `headers` section.

0 commit comments

Comments
 (0)