> For the complete documentation index, see [llms.txt](https://book.ferro.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.ferro.pro/db/loki.md).

# loki

* [API](/db/loki.md#api)
  * [Query](/db/loki.md#query)
* [Python](/db/loki.md#python)

## API

### Query

<https://grafana.com/docs/loki/latest/api/#examples>

```
curl -G -s  "http://localhost:3100/loki/api/v1/query" \
    --data-urlencode 'query=sum(rate({job="varlogs"}[10m])) by (level)' \
    | jq
```

## Python

<https://pypi.org/project/python-logging-loki/>
