2023-07-14 12:12:23 +02:00
|
|
|
---
|
2023-10-05 10:24:19 +02:00
|
|
|
sort: 1
|
|
|
|
weight: 1
|
2023-07-14 12:12:23 +02:00
|
|
|
title: VictoriaLogs Quick Start
|
|
|
|
menu:
|
|
|
|
docs:
|
|
|
|
parent: "victorialogs"
|
2023-10-05 10:24:19 +02:00
|
|
|
weight: 1
|
2023-07-14 12:12:23 +02:00
|
|
|
aliases:
|
2023-07-14 12:14:10 +02:00
|
|
|
- /VictoriaLogs/QuickStart.html
|
2023-07-14 12:12:23 +02:00
|
|
|
---
|
|
|
|
|
2023-06-21 07:08:19 +02:00
|
|
|
# VictoriaLogs Quick Start
|
|
|
|
|
2023-10-14 14:41:04 +02:00
|
|
|
It is recommended to read [README](/VictoriaLogs/)
|
|
|
|
and [Key Concepts](/VictoriaLogs/keyConcepts.html)
|
2023-06-21 07:08:19 +02:00
|
|
|
before you start working with VictoriaLogs.
|
|
|
|
|
|
|
|
## How to install and run VictoriaLogs
|
|
|
|
|
|
|
|
There are the following options exist:
|
|
|
|
|
2023-06-22 06:52:30 +02:00
|
|
|
- [To run pre-built binaries](#pre-built-binaries)
|
2023-06-21 07:08:19 +02:00
|
|
|
- [To run Docker image](#docker-image)
|
2023-06-22 02:28:28 +02:00
|
|
|
- [To run in Kubernetes with Helm charts](#helm-charts)
|
2023-06-21 07:08:19 +02:00
|
|
|
- [To build VictoriaLogs from source code](#building-from-source-code)
|
|
|
|
|
2023-06-22 06:52:30 +02:00
|
|
|
### Pre-built binaries
|
|
|
|
|
|
|
|
Pre-built binaries for VictoriaLogs are availble at the [releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/) page.
|
|
|
|
Just download archive for the needed Operating system and architecture, unpack it and run `victoria-logs-prod` from it.
|
|
|
|
|
|
|
|
For example, the following commands download VictoriaLogs archive for Linux/amd64, unpack and run it:
|
|
|
|
|
|
|
|
```bash
|
2023-10-04 14:43:31 +02:00
|
|
|
curl -L -O https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v0.4.1-victorialogs/victoria-logs-linux-amd64-v0.4.1-victorialogs.tar.gz
|
|
|
|
tar xzf victoria-logs-linux-amd64-v0.4.1-victorialogs.tar.gz
|
2023-06-22 06:52:30 +02:00
|
|
|
./victoria-logs-prod
|
|
|
|
```
|
|
|
|
|
2023-10-14 14:41:04 +02:00
|
|
|
VictoriaLogs is ready for [data ingestion](/VictoriaLogs/data-ingestion/)
|
|
|
|
and [querying](/VictoriaLogs/querying/) at the TCP port `9428` now!
|
2023-06-22 06:52:30 +02:00
|
|
|
It has no any external dependencies, so it may run in various environments without additional setup and configuration.
|
|
|
|
VictoriaLogs automatically adapts to the available CPU and RAM resources. It also automatically setups and creates
|
2023-10-14 14:41:04 +02:00
|
|
|
the needed indexes during [data ingestion](/VictoriaLogs/data-ingestion/).
|
2023-06-22 06:52:30 +02:00
|
|
|
|
|
|
|
See also:
|
|
|
|
|
|
|
|
- [How to configure VictoriaLogs](#how-to-configure-victorialogs)
|
2023-10-14 14:41:04 +02:00
|
|
|
- [How to ingest logs into VictoriaLogs](/VictoriaLogs/data-ingestion/)
|
|
|
|
- [How to query VictoriaLogs](/VictoriaLogs/querying/)
|
2023-06-22 06:52:30 +02:00
|
|
|
|
|
|
|
|
2023-06-21 07:08:19 +02:00
|
|
|
### Docker image
|
|
|
|
|
|
|
|
You can run VictoriaLogs in a Docker container. It is the easiest way to start using VictoriaLogs.
|
|
|
|
Here is the command to run VictoriaLogs in a Docker container:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker run --rm -it -p 9428:9428 -v ./victoria-logs-data:/victoria-logs-data \
|
2023-10-04 14:43:31 +02:00
|
|
|
docker.io/victoriametrics/victoria-logs:v0.4.1-victorialogs
|
2023-06-21 07:08:19 +02:00
|
|
|
```
|
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
See also:
|
|
|
|
|
|
|
|
- [How to configure VictoriaLogs](#how-to-configure-victorialogs)
|
2023-10-14 14:41:04 +02:00
|
|
|
- [How to ingest logs into VictoriaLogs](/VictoriaLogs/data-ingestion/)
|
|
|
|
- [How to query VictoriaLogs](/VictoriaLogs/querying/)
|
2023-06-22 02:28:28 +02:00
|
|
|
|
2023-06-21 16:58:43 +02:00
|
|
|
### Helm charts
|
|
|
|
|
|
|
|
You can run VictoriaLogs in Kubernetes environment
|
2023-06-22 02:28:28 +02:00
|
|
|
with [these Helm charts](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-logs-single/README.md).
|
2023-06-21 16:58:43 +02:00
|
|
|
|
2023-06-21 07:08:19 +02:00
|
|
|
### Building from source code
|
|
|
|
|
|
|
|
Follow the following steps in order to build VictoriaLogs from source code:
|
|
|
|
|
|
|
|
- Checkout VictoriaLogs source code. It is located in the VictoriaMetrics repository:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone https://github.com/VictoriaMetrics/VictoriaMetrics
|
|
|
|
cd VictoriaMetrics
|
|
|
|
```
|
|
|
|
|
|
|
|
- Build VictoriaLogs. The build command requires [Go 1.20](https://golang.org/doc/install).
|
|
|
|
|
|
|
|
```bash
|
|
|
|
make victoria-logs
|
|
|
|
```
|
|
|
|
|
|
|
|
- Run the built binary:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
bin/victoria-logs
|
|
|
|
```
|
|
|
|
|
2023-10-14 14:41:04 +02:00
|
|
|
VictoriaLogs is ready for [data ingestion](/VictoriaLogs/data-ingestion/)
|
|
|
|
and [querying](/VictoriaLogs/querying/) at the TCP port `9428` now!
|
2023-06-21 07:08:19 +02:00
|
|
|
It has no any external dependencies, so it may run in various environments without additional setup and configuration.
|
|
|
|
VictoriaLogs automatically adapts to the available CPU and RAM resources. It also automatically setups and creates
|
2023-10-14 14:41:04 +02:00
|
|
|
the needed indexes during [data ingestion](/VictoriaLogs/data-ingestion/).
|
2023-06-21 07:08:19 +02:00
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
See also:
|
|
|
|
|
|
|
|
- [How to configure VictoriaLogs](#how-to-configure-victorialogs)
|
2023-10-14 14:41:04 +02:00
|
|
|
- [How to ingest logs into VictoriaLogs](/VictoriaLogs/data-ingestion/)
|
|
|
|
- [How to query VictoriaLogs](/VictoriaLogs/querying/)
|
2023-06-22 02:28:28 +02:00
|
|
|
|
|
|
|
|
2023-06-21 16:58:43 +02:00
|
|
|
## How to configure VictoriaLogs
|
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
VictoriaLogs is configured via command-line flags. All the command-line flags have sane defaults,
|
|
|
|
so there is no need in tuning them in general case. VictoriaLogs runs smoothly in most environments
|
|
|
|
without additional configuration.
|
|
|
|
|
|
|
|
Pass `-help` to VictoriaLogs in order to see the list of supported command-line flags with their description and default values:
|
2023-06-21 07:08:19 +02:00
|
|
|
|
|
|
|
```bash
|
2023-06-22 02:28:28 +02:00
|
|
|
/path/to/victoria-logs -help
|
2023-06-21 07:08:19 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
VictoriaLogs stores the ingested data to the `victoria-logs-data` directory by default. The directory can be changed
|
2023-10-14 14:41:04 +02:00
|
|
|
via `-storageDataPath` command-line flag. See [these docs](/VictoriaLogs/#storage) for details.
|
2023-06-21 07:08:19 +02:00
|
|
|
|
2023-10-14 14:41:04 +02:00
|
|
|
By default VictoriaLogs stores [log entries](/VictoriaLogs/keyConcepts.html) with timestamps
|
2023-06-21 07:08:19 +02:00
|
|
|
in the time range `[now-7d, now]`, while dropping logs outside the given time range.
|
2023-10-14 14:41:04 +02:00
|
|
|
E.g. it uses the retention of 7 days. Read [these docs](/VictoriaLogs/#retention) on how to control the retention
|
|
|
|
for the [ingested](/VictoriaLogs/data-ingestion/) logs.
|
2023-06-21 07:08:19 +02:00
|
|
|
|
2023-10-14 14:41:04 +02:00
|
|
|
It is recommended setting up monitoring of VictoriaLogs according to [these docs](/VictoriaLogs/#monitoring).
|
2023-06-21 16:58:43 +02:00
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
See also:
|
2023-06-21 16:58:43 +02:00
|
|
|
|
2023-10-14 14:41:04 +02:00
|
|
|
- [How to ingest logs into VictoriaLogs](/VictoriaLogs/data-ingestion/)
|
|
|
|
- [How to query VictoriaLogs](/VictoriaLogs/querying/)
|
2023-06-21 16:58:43 +02:00
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
## Docker demos
|
2023-06-21 16:58:43 +02:00
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
Here are a Docker-compose demos, which start VictoriaLogs and push logs to it via various log collectors:
|
2023-06-21 16:58:43 +02:00
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
- [Filebeat demo](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker/victorialogs/filebeat-docker)
|
|
|
|
- [Fluentbit demo](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker/victorialogs/fluentbit-docker)
|
|
|
|
- [Logstash demo](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker/victorialogs/logstash)
|
|
|
|
- [Vector demo](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker/victorialogs/vector-docker)
|
2023-07-28 18:46:50 +02:00
|
|
|
- [Promtail demo](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker/victorialogs/promtail)
|
2023-06-21 19:37:36 +02:00
|
|
|
|
2023-06-22 02:28:28 +02:00
|
|
|
You can use [this Helm chart](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-logs-single/README.md)
|
|
|
|
as a demo for running Fluentbit in Kubernetes with VictoriaLogs.
|