Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/cockpit/how-to/send-metrics-logs-to-cockpit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ You can push logs with any Loki compatible agent such as the [Promtail](https://

1. Open a terminal and run `pip install python-logging-loki` or `pip3 install python-logging-loki` if you are using Python 3, to install the [logging_loki](https://pypi.org/project/python-logging-loki/) package to send your Python logs.
2. [Create a Cockpit token](/cockpit/how-to/create-token/) with the **Push** permission for logs.
3. Create a `python_logs.py` Python file and paste the following code snippet into it. Make sure that you replace `000avb0d-34ae-66hh-643b-f9e0n3k17773` with the ID of your logs data source, `$SCW_API_SECRET_KEY` with your API secret key and `$COCKPIT_TOKEN_SECRET_KEY` with your Cockpit token's secret key.
3. Create a `python_logs.py` Python file and paste the following code snippet into it. Make sure that you replace `000avb0d-34ae-66hh-643b-f9e0n3k17773` with the ID of your logs data source and `$COCKPIT_TOKEN_SECRET_KEY` with your Cockpit token's secret key.

```
import logging
Expand Down