mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-18 14:40:26 +01:00
docs/VictoriaLogs: make vlogscli more visible
(cherry picked from commit 9413b2de91
)
This commit is contained in:
parent
834e2ad855
commit
8d4c1cb1d8
@ -36,7 +36,7 @@ For example, the following query finds all the logs with `error` word:
|
|||||||
error
|
error
|
||||||
```
|
```
|
||||||
|
|
||||||
See [how to send queries to VictoriaLogs](https://docs.victoriametrics.com/victorialogs/querying/).
|
It is recommended to use [vlogscli](https://docs.victoriametrics.com/victorialogs/querying/vlogscli/) for querying VictoriaLogs.
|
||||||
|
|
||||||
If the queried [word](#word) clashes with LogsQL keywords, then just wrap it into quotes.
|
If the queried [word](#word) clashes with LogsQL keywords, then just wrap it into quotes.
|
||||||
For example, the following query finds all the log messages with `and` [word](#word):
|
For example, the following query finds all the log messages with `and` [word](#word):
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
[VictoriaLogs](https://docs.victoriametrics.com/victorialogs/) can be queried with [LogsQL](https://docs.victoriametrics.com/victorialogs/logsql/)
|
[VictoriaLogs](https://docs.victoriametrics.com/victorialogs/) can be queried with [LogsQL](https://docs.victoriametrics.com/victorialogs/logsql/)
|
||||||
via the following ways:
|
via the following ways:
|
||||||
|
|
||||||
|
- [Command-line interface](#command-line)
|
||||||
|
- [HTTP API](#http-api)
|
||||||
- [Web UI](#web-ui) - a web-based UI for querying logs
|
- [Web UI](#web-ui) - a web-based UI for querying logs
|
||||||
- [Grafana plugin](#visualization-in-grafana)
|
- [Grafana plugin](#visualization-in-grafana)
|
||||||
- [HTTP API](#http-api)
|
|
||||||
- [Command-line interface](#command-line)
|
|
||||||
|
|
||||||
## HTTP API
|
## HTTP API
|
||||||
|
|
||||||
@ -828,7 +828,7 @@ curl http://localhost:9428/select/logsql/query -d 'query=error'
|
|||||||
If the command above returns "never-ending" response, then just press `ctrl+C` at any time in order to cancel the query.
|
If the command above returns "never-ending" response, then just press `ctrl+C` at any time in order to cancel the query.
|
||||||
VictoriaLogs notices that the response stream is closed, so it cancels the query and stops consuming CPU, RAM and disk IO for this query.
|
VictoriaLogs notices that the response stream is closed, so it cancels the query and stops consuming CPU, RAM and disk IO for this query.
|
||||||
|
|
||||||
Then just use `head` command for investigating the returned log messages and narrowing down the query:
|
Then use `head` command for investigating the returned log messages and narrowing down the query:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl http://localhost:9428/select/logsql/query -d 'query=error' | head -10
|
curl http://localhost:9428/select/logsql/query -d 'query=error' | head -10
|
||||||
@ -865,7 +865,8 @@ curl http://localhost:9428/select/logsql/query -d 'query=error AND "cannot open
|
|||||||
```
|
```
|
||||||
|
|
||||||
Note that the `query` arg must be properly encoded with [percent encoding](https://en.wikipedia.org/wiki/URL_encoding) when passing it to `curl`
|
Note that the `query` arg must be properly encoded with [percent encoding](https://en.wikipedia.org/wiki/URL_encoding) when passing it to `curl`
|
||||||
or similar tools.
|
or similar tools. It is highly recommended to use [vlogscli](https://docs.victoriametrics.com/victorialogs/querying/vlogscli/) -
|
||||||
|
it automatically performs all the needed encoding.
|
||||||
|
|
||||||
The `pipe the query to "head" or "less" -> investigate the results -> refine the query` iteration
|
The `pipe the query to "head" or "less" -> investigate the results -> refine the query` iteration
|
||||||
can be repeated multiple times until the needed log messages are found.
|
can be repeated multiple times until the needed log messages are found.
|
||||||
|
Loading…
Reference in New Issue
Block a user