-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
log_processor/data_sources/victorialogs: add new datasource (#727)
Co-authored-by: Laurence Jones <[email protected]>
- Loading branch information
1 parent
83ce4b3
commit 2e9608f
Showing
3 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
crowdsec-docs/docs/log_processor/data_sources/victorialogs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
--- | ||
id: victorialogs | ||
title: VictoriaLogs | ||
--- | ||
|
||
This module allows the `Security Engine` to acquire logs from VictoriaLogs query. | ||
|
||
## Configuration example | ||
|
||
This will allow to read logs from VictoriaLogs, using the query `app:nginx`. | ||
```yaml | ||
source: victorialogs | ||
mode: tail | ||
log_level: info | ||
url: http://localhost:9428/ | ||
limit: 1000 | ||
query: | | ||
app:nginx | ||
auth: | ||
username: something | ||
password: secret | ||
labels: | ||
type: nginx | ||
``` | ||
:::info | ||
The reader will always start at "now" for `tail` mode. | ||
::: | ||
|
||
Look at the `configuration parameters` to view all supported options. | ||
|
||
## Parameters | ||
|
||
### `mode` | ||
|
||
Mode to fetch the logs, supported values: `tail` and `cat`. | ||
|
||
Defaults to `tail`. | ||
|
||
### `url` | ||
|
||
The VictoriaLogs URL to connect to. | ||
|
||
Required. | ||
|
||
### `prefix` | ||
|
||
The VictoriaLogs prefix (present in http path, useful if VictoriaLogs is behind a reverse-proxy). | ||
|
||
Defaults to `/`. | ||
|
||
### `query` | ||
|
||
The [VictoriaLogs query](https://docs.victoriametrics.com/victorialogs/logsql/). | ||
|
||
Required. | ||
|
||
Note that `tail` requests have limitations for operators used query. See [this doc](https://docs.victoriametrics.com/victorialogs/querying/#live-tailing) for the details. | ||
|
||
### `limit` | ||
|
||
The maximum number of messages to be retried from VictoriaLogs at once. | ||
|
||
### `headers` | ||
|
||
Allows you to specify headers to be sent to VictoriaLogs, in the format: | ||
|
||
```yaml | ||
headers: | ||
foo: bar | ||
AccountID: 0 | ||
ProjectID: 0 | ||
``` | ||
|
||
See this doc for more information: [VictoriaLogs headers](https://docs.victoriametrics.com/victorialogs/querying/#http-api) | ||
|
||
### `wait_for_ready` | ||
|
||
The retry interval at startup before giving on VictoriaLogs. | ||
|
||
Defaults to `10 seconds`. | ||
|
||
### `auth` | ||
|
||
Login/password authentication for VictoriaLogs, in the format: | ||
|
||
```yaml | ||
auth: | ||
username: someone | ||
password: something | ||
``` | ||
|
||
### `max_failure_duration` | ||
|
||
The maximum duration VictoriaLogs is allowed to be unavailable (once startup is successful) before giving up on the data source. | ||
|
||
Default to `30 seconds`. | ||
|
||
|
||
## DSN and command-line | ||
|
||
All the parameters above are available via DNS (one-shot mode), plus the following ones: | ||
|
||
### `ssl` | ||
|
||
if present, scheme will be set to `https` | ||
|
||
### `since` | ||
|
||
Allows to set the "start" duration for VictoriaLogs query. | ||
|
||
### `log_level` | ||
|
||
Set the `log_level` for VictoriaLogs datasource. | ||
|
||
```bash | ||
crowdsec -type foobar -dsn 'victorialogs://login:password@localhost:9428/?query=server:"demoVictoriaLogsVictoriaLogs"' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters