%%
date:: [[2024-04-24]]
parent::
%%
# [[How to enable Explore Logs for Loki]]
![[How to enable Explore Logs for Loki.svg]]
*The panels from the Explore Logs app* [^repo]
[repo](https://github.com/grafana/explore-logs)
Explore Logs is a UI on [[Grafana]] for visualizing and analyzing logs from [[Grafana Loki|Loki]] without having to use [[LogQL]]. It's an [[Open-source]] feature, and is also available on [[Grafana Cloud]]. It was announced as part of [[Loki 3.0]] in [[GrafanaCON 2024]].
## Enabling Explore Logs on Docker
You can use Explore Logs with Grafana and Loki anywhere, but here's what you need to do to get it working when running [[Grafana]] and [[Grafana Loki|Loki]] within [[Docker]] using [[Docker Compose]].
> [!tip] Sample repo
> To see a simple app instrumented with [[Grafana Alloy]], sending logs to [[Grafana Loki|Loki]], and using [[Grafana]] for visualization with Explore Logs, check out [the Carnivorous Green House repo](https://github.com/grafana/loki-fundamentals/tree/what-is-loki).
### Modify the Loki config file
In the Loki [[YAML]] file, make sure the pattern ingester is enabled by adding these lines:
```yaml
pattern_ingester:
enabled: true
```
This allows the logs to be analyzed for patterns (this also enables the creation of [[Bloom filter]]s).
Then, modify the `limits_config` block or add these lines:
```yaml
limits_config:
allow_structured_metadata: true
volume_enabled: true
```
### Modify the Docker Compose config
Then, you'll need to modify the Grafana and Loki sections of the Docker Compose config.
### Change the Loki image version
At the time of this writing, `loki:latest` does not yet support Explore Logs, so you need to specify a static Loki image that does. Use:
```yaml
loki:
image: grafana/loki:main-e9b6ce9
```
You can [view a sample Loki config here](https://github.com/grafana/loki-fundamentals/blob/what-is-loki/loki-config.yaml).
### Change the Grafana version
In the same way, the `latest` version of Grafana does not yet support it either, so you'll need to specify the special preview version:
```yaml
grafana:
image: grafana/grafana:11.0.0-preview
```
### Add the Explore Logs plugin
Explore Logs is a Grafana plugin that you'll need to enable. Use: `GF_INSTALL_PLUGINS=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app` in your config like so:
```yaml
grafana:
image: grafana/grafana:11.0.0-preview
environment:
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_BASIC_ENABLED=false
- GF_FEATURE_TOGGLES_ENABLE=accessControlOnCall
- GF_INSTALL_PLUGINS=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app
```
You can view a [sample docker-compose.yml here](https://github.com/grafana/loki-fundamentals/blob/what-is-loki/docker-compose.yml).
%%
# Text Elements
# Embedded files
5bf2d1887fe1d16cb165d07f299776bcbacd50f8: [[grafana-loki-explore-logs.png]]
# Drawing
```json
{
"type": "excalidraw",
"version": 2,
"source": "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.1.6",
"elements": [
{
"id": "6EjWFYJFeCHjCq4MzQ0ft",
"type": "image",
"x": -445.82557943989246,
"y": -344.85323333740234,
"width": 1011.1764705882352,
"height": 573,
"angle": 0,
"strokeColor": "transparent",
"backgroundColor": "transparent",
"fillStyle": "solid",
"strokeWidth": 2,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"frameId": null,
"roundness": null,
"seed": 1493999584,
"version": 4,
"versionNonce": 138292192,
"isDeleted": false,
"boundElements": null,
"updated": 1713991532908,
"link": null,
"locked": false,
"status": "pending",
"fileId": "5bf2d1887fe1d16cb165d07f299776bcbacd50f8",
"scale": [
1,
1
]
}
],
"appState": {
"theme": "dark",
"viewBackgroundColor": "#ffffff",
"currentItemStrokeColor": "#1e1e1e",
"currentItemBackgroundColor": "transparent",
"currentItemFillStyle": "solid",
"currentItemStrokeWidth": 2,
"currentItemStrokeStyle": "solid",
"currentItemRoughness": 1,
"currentItemOpacity": 100,
"currentItemFontFamily": 4,
"currentItemFontSize": 20,
"currentItemTextAlign": "left",
"currentItemStartArrowhead": null,
"currentItemEndArrowhead": "arrow",
"scrollX": 583.2388916015625,
"scrollY": 573.6323852539062,
"zoom": {
"value": 1
},
"currentItemRoundness": "round",
"gridSize": null,
"gridColor": {
"Bold": "#C9C9C9FF",
"Regular": "#EDEDEDFF"
},
"currentStrokeOptions": null,
"previousGridSize": null,
"frameRendering": {
"enabled": true,
"clip": true,
"name": true,
"outline": true
},
"objectsSnapModeEnabled": false
},
"files": {}
}
```
%%
[^repo]: Grafana Labs (2024). *Explore Logs*. Retrieved from GitHub: https://github.com/grafana/explore-logs