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
= Forwarding logs to an external Loki logging system
4
8
5
-
You can forward logs to an external Loki logging system in addition to, or instead of, the internal default {product-title} Elasticsearch instance.
9
+
You can forward logs to an external Loki logging system in addition to, or instead of, the default log store.
6
10
7
11
To configure log forwarding to Loki, you must create a `ClusterLogForwarder` custom resource (CR) with an output to Loki, and a pipeline that uses the output. The output to Loki can use the HTTP (insecure) or HTTPS (secure HTTP) connection.
8
12
@@ -24,27 +28,29 @@ metadata:
24
28
spec:
25
29
serviceAccountName: <service_account_name> <3>
26
30
outputs:
27
-
- name: loki-insecure <4>
28
-
type: "loki" <5>
29
-
url: http://loki.insecure.com:3100 <6>
30
-
loki:
31
-
tenantKey: kubernetes.namespace_name
32
-
labelKeys: kubernetes.labels.foo
33
-
- name: loki-secure <7>
34
-
type: "loki"
35
-
url: https://loki.secure.com:3100
36
-
secret:
37
-
name: loki-secret <8>
38
-
loki:
39
-
tenantKey: kubernetes.namespace_name <9>
40
-
labelKeys: kubernetes.labels.foo <10>
31
+
- name: loki-insecure <4>
32
+
type: "loki" <5>
33
+
url: http://loki.insecure.com:3100 <6>
34
+
loki:
35
+
tenantKey: kubernetes.namespace_name
36
+
labelKeys:
37
+
- kubernetes.labels.foo
38
+
- name: loki-secure <7>
39
+
type: "loki"
40
+
url: https://loki.secure.com:3100
41
+
secret:
42
+
name: loki-secret <8>
43
+
loki:
44
+
tenantKey: kubernetes.namespace_name <9>
45
+
labelKeys:
46
+
- kubernetes.labels.foo <10>
41
47
pipelines:
42
-
- name: application-logs <11>
43
-
inputRefs: <12>
44
-
- application
45
-
- audit
46
-
outputRefs: <13>
47
-
- loki-secure
48
+
- name: application-logs <11>
49
+
inputRefs: <12>
50
+
- application
51
+
- audit
52
+
outputRefs: <13>
53
+
- loki-secure
48
54
----
49
55
<1> In legacy implementations, the CR name must be `instance`. In multi log forwarder implementations, you can use any name.
50
56
<2> In legacy implementations, the CR namespace must be `openshift-logging`. In multi log forwarder implementations, you can use any namespace.
@@ -65,10 +71,9 @@ spec:
65
71
Because Loki requires log streams to be correctly ordered by timestamp, `labelKeys` always includes the `kubernetes_host` label set, even if you do not specify it. This inclusion ensures that each stream originates from a single host, which prevents timestamps from becoming disordered due to clock differences on different hosts.
66
72
====
67
73
68
-
69
-
. Create the CR object:
74
+
. Apply the `ClusterLogForwarder` CR object by running the following command:
0 commit comments