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 application logs from specific projects
8
8
9
-
You can use the Cluster Log Forwarder to send a copy of the application logs from specific projects to an external log aggregator. You can do this in addition to, or instead of, using the default Elasticsearch log store. You must also configure the external log aggregator to receive log data from {product-title}.
9
+
You can forward a copy of the application logs from specific projects to an external log aggregator, in addition to, or instead of, using the internal log store. You must also configure the external log aggregator to receive log data from {product-title}.
10
10
11
11
To configure forwarding application logs from a project, you must create a `ClusterLogForwarder` custom resource (CR) with at least one input from a project, optional outputs for other log aggregators, and pipelines that use those inputs and outputs.
12
12
@@ -16,8 +16,9 @@ To configure forwarding application logs from a project, you must create a `Clus
16
16
17
17
.Procedure
18
18
19
-
. Create or edit a YAML file that defines the `ClusterLogForwarder` CR object:
19
+
. Create or edit a YAML file that defines the `ClusterLogForwarder` CR:
20
20
+
21
+
.Example `ClusterLogForwarder` CR
21
22
[source,yaml]
22
23
----
23
24
apiVersion: logging.openshift.io/v1
@@ -39,18 +40,18 @@ spec:
39
40
- name: my-app-logs
40
41
application:
41
42
namespaces:
42
-
- my-project
43
+
- my-project <8>
43
44
pipelines:
44
-
- name: forward-to-fluentd-insecure <8>
45
-
inputRefs: <9>
45
+
- name: forward-to-fluentd-insecure <9>
46
+
inputRefs: <10>
46
47
- my-app-logs
47
-
outputRefs: <10>
48
+
outputRefs: <11>
48
49
- fluentd-server-insecure
49
50
labels:
50
-
project: "my-project" <11>
51
-
- name: forward-to-fluentd-secure <12>
51
+
project: "my-project" <12>
52
+
- name: forward-to-fluentd-secure <13>
52
53
inputRefs:
53
-
- application
54
+
- application <14>
54
55
- audit
55
56
- infrastructure
56
57
outputRefs:
@@ -61,25 +62,28 @@ spec:
61
62
----
62
63
<1> The name of the `ClusterLogForwarder` CR must be `instance`.
63
64
<2> The namespace for the `ClusterLogForwarder` CR must be `openshift-logging`.
64
-
<3> Specify a name for the output.
65
-
<4> Specify the output type: `elasticsearch`, `fluentdForward`, `syslog`, or `kafka`.
66
-
<5> Specify the URL and port of the external log aggregator as a valid absolute URL. If the cluster-wide proxy using the CIDR annotation is enabled, the output must be a server name or FQDN, not an IP address.
65
+
<3> The name of the output.
66
+
<4> The output type: `elasticsearch`, `fluentdForward`, `syslog`, or `kafka`.
67
+
<5> The URL and port of the external log aggregator as a valid absolute URL. If the cluster-wide proxy using the CIDR annotation is enabled, the output must be a server name or FQDN, not an IP address.
67
68
<6> If using a `tls` prefix, you must specify the name of the secret required by the endpoint for TLS communication. The secret must exist in the `openshift-logging` project and have *tls.crt*, *tls.key*, and *ca-bundle.crt* keys that each point to the certificates they represent.
68
-
<7> Configuration for an input to filter application logs from the specified projects.
69
-
<8> Configuration for a pipeline to use the input to send project application logs to an external Fluentd instance.
70
-
<9> The `my-app-logs` input.
71
-
<10> The name of the output to use.
72
-
<11> Optional: String. One or more labels to add to the logs.
73
-
<12> Configuration for a pipeline to send logs to other log aggregators.
74
-
** Optional: Specify a name for the pipeline.
75
-
** Specify which log types to forward by using the pipeline: `application,``infrastructure`, or `audit`.
76
-
** Specify the name of the output to use when forwarding logs with this pipeline.
77
-
** Optional: Specify the `default` output to forward logs to the internal Elasticsearch instance.
78
-
** Optional: String. One or more labels to add to the logs.
69
+
<7> The configuration for an input to filter application logs from the specified projects.
70
+
<8> If no namespace is specified, logs are collected from all namespaces.
71
+
<9> The pipeline configuration directs logs from a named input to a named output. In this example, a pipeline named `forward-to-fluentd-insecure` forwards logs from an input named `my-app-logs` to an output named `fluentd-server-insecure`.
72
+
<10> A list of inputs.
73
+
<11> The name of the output to use.
74
+
<12> Optional: String. One or more labels to add to the logs.
75
+
<13> Configuration for a pipeline to send logs to other log aggregators.
76
+
+
77
+
* Optional: Specify a name for the pipeline.
78
+
* Specify which log types to forward by using the pipeline: `application,``infrastructure`, or `audit`.
79
+
* Specify the name of the output to use when forwarding logs with this pipeline.
80
+
* Optional: Specify the `default` output to forward logs to the default log store.
81
+
* Optional: String. One or more labels to add to the logs.
82
+
<14> Note that application logs from all namespaces are collected when using this configuration.
79
83
80
-
. Create the CR object:
84
+
. Apply the `ClusterLogForwarder`CR by running the following command:
0 commit comments