diff --git a/loki/logcli-tutorial/intro.md b/loki/logcli-tutorial/intro.md index 21da3f4..85baed7 100644 --- a/loki/logcli-tutorial/intro.md +++ b/loki/logcli-tutorial/intro.md @@ -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 diff --git a/loki/logcli-tutorial/preprocessed.md b/loki/logcli-tutorial/preprocessed.md index 8e8cf56..e1f8001 100755 --- a/loki/logcli-tutorial/preprocessed.md +++ b/loki/logcli-tutorial/preprocessed.md @@ -18,7 +18,7 @@ killercoda: # LogCLI tutorial -This [LogCLI](https://grafana.com/docs/loki//query/logcli/) tutorial will walk you through the following concepts: +This [LogCLI](https://grafana.com/docs/loki//query/logcli/) tutorial will walk you through the following concepts: * Querying logs * Meta Queries against your Loki instance @@ -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 \ @@ -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"}' ``` diff --git a/loki/logcli-tutorial/setup.sh b/loki/logcli-tutorial/setup.sh index d2c0bd2..d8aeef1 100644 --- a/loki/logcli-tutorial/setup.sh +++ b/loki/logcli-tutorial/setup.sh @@ -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." \ No newline at end of file +sudo dpkg -i logcli_3.3.0_amd64.deb && clear && echo "Setup complete. You may now begin the tutorial." \ No newline at end of file diff --git a/loki/logcli-tutorial/step2.md b/loki/logcli-tutorial/step2.md index 6673c23..237a1af 100644 --- a/loki/logcli-tutorial/step2.md +++ b/loki/logcli-tutorial/step2.md @@ -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 \ @@ -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}}