You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -115,9 +116,9 @@ The pipeline is constructed of a sequence of stages:
115
116
- **ingest** - obtain flows from some source, one entry per line
116
117
- **decode** - parse input lines into a known format, e.g., dictionary (map) of AWS or goflow data
117
118
- **transform** - convert entries into a standard format; can include multiple transform stages
119
+
- **write** - provide the means to write the data to some target, e.g. loki, standard output, etc
118
120
- **extract** - derive a set of metrics from the imported flows
119
121
- **encode** - make the data available in appropriate format (e.g. prometheus)
120
-
- **write** - provide the means to transfer the data to some target, e.g. prometheus, object store, standard output, etc
121
122
122
123
The **encode** and **write** stages may be combined in some cases (as in prometheus), in which case**write** is set to **none**
123
124
@@ -398,6 +399,34 @@ The name of the prometheus gauge is set to `test_Bytes` by concatenating the pre
398
399
The `packets` metric is very similar. It makes use of the `counter` prometheus type which adds reported values
399
400
to prometheus counter.
400
401
402
+
### Loki writer
403
+
404
+
The loki writer persist flow-logs into [Loki](https://github.com/grafana/loki). The flow-logs are sent with defined
405
+
tenant ID and with a set static labels and dynamic labels from the record fields.
406
+
For example, sending flow-logs into tenant `theTenant` with labels
407
+
from `foo` and `bar` fields
408
+
and including static label with key `job` with value `flowlogs2metrics`.
409
+
Additional parameters such as `url` and `batchWait` are defined in
410
+
Loki writer API [docs/api.md](docs/api.md)
411
+
412
+
```bash
413
+
pipeline:
414
+
write:
415
+
type: loki
416
+
loki:
417
+
tenantID: theTenant
418
+
loki:
419
+
url: http://loki.default.svc.cluster.local:3100
420
+
staticLabels:
421
+
job: flowlogs2metrics
422
+
batchWait: 1m
423
+
labels:
424
+
- foo
425
+
- bar
426
+
```
427
+
428
+
> Note: to view loki flow-logs in`grafana`:: Use the `Explore` tab and choose the `loki` datasource. In the `Log Browser` enter `{job="flowlogs2metrics"}` and press `Run query`
0 commit comments