Skip to content

Commit

Permalink
fixed command
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayclifford345 committed Nov 27, 2024
1 parent 5048384 commit 98128c5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion loki/logcli-tutorial/intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LogCLI tutorial

This [LogCLI](https://grafana.com/docs/loki/%3CVERSION%3E/query/logcli/) tutorial will walk you through the following concepts:
This [LogCLI](https://grafana.com/docs/loki/latest/query/logcli/) tutorial will walk you through the following concepts:

- Querying logs

Expand Down
12 changes: 9 additions & 3 deletions loki/logcli-tutorial/preprocessed.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ killercoda:

# LogCLI tutorial

This [LogCLI](https://grafana.com/docs/loki/<VERSION>/query/logcli/) tutorial will walk you through the following concepts:
This [LogCLI](https://grafana.com/docs/loki/<LOKI_VERSION>/query/logcli/) tutorial will walk you through the following concepts:

* Querying logs
* Meta Queries against your Loki instance
Expand Down Expand Up @@ -178,7 +178,14 @@ This will return a result similar to the following:

### Writing query results to a file

Another useful feature of LogCLI is the ability to write the query results to a file. This can be useful for offloading the results of our inventory report.
Another useful feature of LogCLI is the ability to write the query results to a file. This can be useful for offloading the results of our inventory report:

First we need to create a directory to store the logs:
```bash
mkdir -p ./inventory
```

Next we can run the following query to write the logs to the `./inventory` directory:

```bash
logcli query \
Expand All @@ -188,7 +195,6 @@ Another useful feature of LogCLI is the ability to write the query results to a
--parallel-max-workers="4" \
--part-path-prefix="./inventory/inv" \
--since=24h \
--forwards \
'{service_name="Delivery World"}'
```

Expand Down
3 changes: 1 addition & 2 deletions loki/logcli-tutorial/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ readonly ARCH VERSION_CODENAME
printf 'deb [arch=%s signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu %s stable' "${ARCH}" "${VERSION_CODENAME}" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install -y docker-compose-plugin && \
wget https://github.com/grafana/loki/releases/download/v3.3.0/logcli_3.3.0_amd64.deb && \
sudo dpkg -i logcli_3.3.0_amd64.deb
clear && echo "Setup complete. You may now begin the tutorial."
sudo dpkg -i logcli_3.3.0_amd64.deb && clear && echo "Setup complete. You may now begin the tutorial."
11 changes: 9 additions & 2 deletions loki/logcli-tutorial/step2.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ This will return a result similar to the following:
## Writing query results to a file
Another useful feature of LogCLI is the ability to write the query results to a file. This can be useful for offloading the results of our inventory report.
Another useful feature of LogCLI is the ability to write the query results to a file. This can be useful for offloading the results of our inventory report:
First we need to create a directory to store the logs:
```bash
mkdir -p ./inventory
```{{exec}}
Next we can run the following query to write the logs to the `./inventory`{{copy}} directory:
```bash
logcli query \
Expand All @@ -81,7 +89,6 @@ Another useful feature of LogCLI is the ability to write the query results to a
--parallel-max-workers="4" \
--part-path-prefix="./inventory/inv" \
--since=24h \
--forwards \
'{service_name="Delivery World"}'
```{{exec}}
Expand Down

0 comments on commit 98128c5

Please sign in to comment.