%%
date:: [[2024-07-10]], [[2024-08-01]], [[2024-09-17]]
parent::
%%
# [[Ingesting logs into Loki]]
![[Ingesting logs into Loki.svg]]
Before you can visualise [[Logs]] sent to [[Grafana Loki|Loki]], you need a way to *ingest* them. [[Log ingestion]] refers to the process of collecting log data and forwarding it to a database, in this case Loki. [[Telemetry collector|Telemetry collectors]] are tools that can be used for log ingestion. Here are a few that work particularly well with Loki:
- [[Promtail]] is a collector that is built into Loki and may still be the easiest way to get started.
- The [[OpenTelemetry Collector]] uses the [[OpenTelemetry|OTel]] standard when collecting logs.
- [[Grafana Alloy]] is the new recommended way to ingest logs into Loki because it is optimised for many [[Grafana Labs]] projects and natively supports both the [[Prometheus]] and [[OpenTelemetry|OTel]] formats for logs.
- [[fluentd]], [[Fluent Bit]], and [[Logstash]] also work as ingestors for Loki.
## Ingest format
### Unstructured
### Structured
[[OpenTelemetry and Loki]]
%%
# Text Elements
# Drawing
```json
{
"type": "excalidraw",
"version": 2,
"source": "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.1.4",
"elements": [
{
"id": "4y8R7iOA",
"type": "text",
"x": 118.49495565891266,
"y": -333.44393157958984,
"width": 3.8599853515625,
"height": 24,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
"fillStyle": "solid",
"strokeWidth": 2,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"frameId": null,
"roundness": null,
"seed": 967149026,
"version": 2,
"versionNonce": 939059582,
"isDeleted": true,
"boundElements": null,
"updated": 1713723615080,
"link": null,
"locked": false,
"text": "",
"rawText": "",
"fontSize": 20,
"fontFamily": 4,
"textAlign": "left",
"verticalAlign": "top",
"containerId": null,
"originalText": "",
"lineHeight": 1.2
}
],
"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
}
},
"files": {}
}
```
%%