|
| 1 | +--- |
| 2 | +id: victorialogs |
| 3 | +title: VictoriaLogs |
| 4 | +--- |
| 5 | + |
| 6 | +This module allows the `Security Engine` to acquire logs from VictoriaLogs query. |
| 7 | + |
| 8 | +## Configuration example |
| 9 | + |
| 10 | +This will allow to read logs from VictoriaLogs, using the query `app:nginx`. |
| 11 | +```yaml |
| 12 | +source: victorialogs |
| 13 | +mode: tail |
| 14 | +log_level: info |
| 15 | +url: http://localhost:9428/ |
| 16 | +limit: 1000 |
| 17 | +query: | |
| 18 | + app:nginx |
| 19 | +auth: |
| 20 | + username: something |
| 21 | + password: secret |
| 22 | +labels: |
| 23 | + type: nginx |
| 24 | +``` |
| 25 | +
|
| 26 | +:::info |
| 27 | +The reader will always start at "now" for `tail` mode. |
| 28 | +::: |
| 29 | + |
| 30 | +Look at the `configuration parameters` to view all supported options. |
| 31 | + |
| 32 | +## Parameters |
| 33 | + |
| 34 | +### `mode` |
| 35 | + |
| 36 | +Mode to fetch the logs, supported values: `tail` and `cat`. |
| 37 | + |
| 38 | +Defaults to `tail`. |
| 39 | + |
| 40 | +### `url` |
| 41 | + |
| 42 | +The VictoriaLogs URL to connect to. |
| 43 | + |
| 44 | +Required. |
| 45 | + |
| 46 | +### `prefix` |
| 47 | + |
| 48 | +The VictoriaLogs prefix (present in http path, useful if VictoriaLogs is behind a reverse-proxy). |
| 49 | + |
| 50 | +Defaults to `/`. |
| 51 | + |
| 52 | +### `query` |
| 53 | + |
| 54 | +The [VictoriaLogs query](https://docs.victoriametrics.com/victorialogs/logsql/). |
| 55 | + |
| 56 | +Required. |
| 57 | + |
| 58 | +Note that `tail` requests have limitations for operators used query. See [this doc](https://docs.victoriametrics.com/victorialogs/querying/#live-tailing) for the details. |
| 59 | + |
| 60 | +### `limit` |
| 61 | + |
| 62 | +The maximum number of messages to be retried from VictoriaLogs at once. |
| 63 | + |
| 64 | +### `headers` |
| 65 | + |
| 66 | +Allows you to specify headers to be sent to VictoriaLogs, in the format: |
| 67 | + |
| 68 | +```yaml |
| 69 | +headers: |
| 70 | + foo: bar |
| 71 | + AccountID: 0 |
| 72 | + ProjectID: 0 |
| 73 | +``` |
| 74 | + |
| 75 | +See this doc for more information: [VictoriaLogs headers](https://docs.victoriametrics.com/victorialogs/querying/#http-api) |
| 76 | + |
| 77 | +### `wait_for_ready` |
| 78 | + |
| 79 | +The retry interval at startup before giving on VictoriaLogs. |
| 80 | + |
| 81 | +Defaults to `10 seconds`. |
| 82 | + |
| 83 | +### `auth` |
| 84 | + |
| 85 | +Login/password authentication for VictoriaLogs, in the format: |
| 86 | + |
| 87 | +```yaml |
| 88 | +auth: |
| 89 | + username: someone |
| 90 | + password: something |
| 91 | +``` |
| 92 | + |
| 93 | +### `max_failure_duration` |
| 94 | + |
| 95 | +The maximum duration VictoriaLogs is allowed to be unavailable (once startup is successful) before giving up on the data source. |
| 96 | + |
| 97 | +Default to `30 seconds`. |
| 98 | + |
| 99 | + |
| 100 | +## DSN and command-line |
| 101 | + |
| 102 | +All the parameters above are available via DNS (one-shot mode), plus the following ones: |
| 103 | + |
| 104 | +### `ssl` |
| 105 | + |
| 106 | +if present, scheme will be set to `https` |
| 107 | + |
| 108 | +### `since` |
| 109 | + |
| 110 | +Allows to set the "start" duration for VictoriaLogs query. |
| 111 | + |
| 112 | +### `log_level` |
| 113 | + |
| 114 | +Set the `log_level` for VictoriaLogs datasource. |
| 115 | + |
| 116 | +```bash |
| 117 | +crowdsec -type foobar -dsn 'victorialogs://login:password@localhost:9428/?query=server:"demoVictoriaLogsVictoriaLogs"' |
| 118 | +``` |
0 commit comments