Skip to content

Commit f580d37

Browse files
authored
Merge pull request #69280 from abrennan89/OBSDOCS-124
OBSDOCS-124: Added details for ES8 in the log forwarder example
2 parents 84a2efd + dd466ea commit f580d37

File tree

1 file changed

+32
-37
lines changed

1 file changed

+32
-37
lines changed
Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * logging/log_collection_forwarding/log-forwarding.adoc
4+
15
:_mod-docs-content-type: PROCEDURE
26
[id="cluster-logging-collector-log-forward-es_{context}"]
37
= Forwarding logs to an external Elasticsearch instance
48

5-
You can optionally forward logs to an external Elasticsearch instance in addition to, or instead of, the internal {product-title} Elasticsearch instance. You are responsible for configuring the external log aggregator to receive log data from {product-title}.
9+
You can forward logs to an external Elasticsearch instance in addition to, or instead of, the internal log store. You are responsible for configuring the external log aggregator to receive log data from {product-title}.
610

711
To configure log forwarding to an external Elasticsearch instance, you must create a `ClusterLogForwarder` custom resource (CR) with an output to that instance, and a pipeline that uses the output. The external Elasticsearch output can use the HTTP (insecure) or HTTPS (secure HTTP) connection.
812

9-
To forward logs to both an external and the internal Elasticsearch instance, create outputs and pipelines to the external instance and a pipeline that uses the `default` output to forward logs to the internal instance. You do not need to create a `default` output. If you do configure a `default` output, you receive an error message because the `default` output is reserved for the {clo}.
13+
To forward logs to both an external and the internal Elasticsearch instance, create outputs and pipelines to the external instance and a pipeline that uses the `default` output to forward logs to the internal instance.
1014

1115
[NOTE]
1216
====
13-
If you want to forward logs to *only* the internal {product-title} Elasticsearch instance, you do not need to create a `ClusterLogForwarder` CR.
17+
If you only want to forward logs to an internal Elasticsearch instance, you do not need to create a `ClusterLogForwarder` CR.
1418
====
1519

1620
.Prerequisites
@@ -19,68 +23,57 @@ If you want to forward logs to *only* the internal {product-title} Elasticsearch
1923
2024
.Procedure
2125

22-
. Create or edit a YAML file that defines the `ClusterLogForwarder` CR object:
26+
. Create or edit a YAML file that defines the `ClusterLogForwarder` CR:
2327
+
28+
.Example `ClusterLogForwarder` CR
2429
[source,yaml]
2530
----
2631
apiVersion: logging.openshift.io/v1
2732
kind: ClusterLogForwarder
2833
metadata:
29-
name: <log_forwarder_name> <1>
30-
namespace: <log_forwarder_namespace> <2>
34+
name: <log_forwarder_name> # <1>
35+
namespace: <log_forwarder_namespace> # <2>
3136
spec:
32-
serviceAccountName: <service_account_name> <3>
37+
serviceAccountName: <service_account_name> # <3>
3338
outputs:
34-
- name: elasticsearch-insecure <4>
35-
type: "elasticsearch" <5>
36-
url: http://elasticsearch.insecure.com:9200 <6>
37-
- name: elasticsearch-secure
38-
type: "elasticsearch"
39-
url: https://elasticsearch.secure.com:9200 <7>
39+
- name: elasticsearch-example # <4>
40+
type: elasticsearch # <5>
41+
elasticsearch:
42+
version: 8 # <6>
43+
url: http://elasticsearch.example.com:9200 # <7>
4044
secret:
41-
name: es-secret <8>
45+
name: es-secret # <8>
4246
pipelines:
43-
- name: application-logs <9>
44-
inputRefs: <10>
47+
- name: application-logs # <9>
48+
inputRefs: # <10>
4549
- application
4650
- audit
4751
outputRefs:
48-
- elasticsearch-secure <11>
49-
- default <12>
50-
labels:
51-
myLabel: "myValue" <13>
52-
- name: infrastructure-audit-logs <14>
53-
inputRefs:
54-
- infrastructure
55-
outputRefs:
56-
- elasticsearch-insecure
52+
- elasticsearch-example # <11>
53+
- default # <12>
5754
labels:
58-
logs: "audit-infra"
55+
myLabel: "myValue" # <13>
56+
# ...
5957
----
6058
<1> In legacy implementations, the CR name must be `instance`. In multi log forwarder implementations, you can use any name.
6159
<2> In legacy implementations, the CR namespace must be `openshift-logging`. In multi log forwarder implementations, you can use any namespace.
6260
<3> The name of your service account. The service account is only required in multi log forwarder implementations if the log forwarder is not deployed in the `openshift-logging` namespace.
6361
<4> Specify a name for the output.
6462
<5> Specify the `elasticsearch` type.
65-
<6> Specify the URL and port of the external Elasticsearch instance as a valid absolute URL. You can use the `http` (insecure) or `https` (secure HTTP) protocol. If the cluster-wide proxy using the CIDR annotation is enabled, the output must be a server name or FQDN, not an IP Address.
66-
<7> For a secure connection, you can specify an `https` or `http` URL that you authenticate by specifying a `secret`.
63+
<6> Specify the Elasticsearch version. This can be `6`, `7`, or `8`.
64+
<7> Specify the URL and port of the external Elasticsearch instance as a valid absolute URL. You can use the `http` (insecure) or `https` (secure HTTP) protocol. If the cluster-wide proxy using the CIDR annotation is enabled, the output must be a server name or FQDN, not an IP Address.
6765
<8> For an `https` prefix, specify the name of the secret required by the endpoint for TLS communication. The secret must contain a `ca-bundle.crt` key that points to the certificate it represents. Otherwise, for `http` and `https` prefixes, you can specify a secret that contains a username and password. In legacy implementations, the secret must exist in the `openshift-logging` project. For more information, see the following "Example: Setting a secret that contains a username and password."
6866
<9> Optional: Specify a name for the pipeline.
6967
<10> Specify which log types to forward by using the pipeline: `application,` `infrastructure`, or `audit`.
7068
<11> Specify the name of the output to use when forwarding logs with this pipeline.
7169
<12> Optional: Specify the `default` output to send the logs to the internal Elasticsearch instance.
7270
<13> Optional: String. One or more labels to add to the logs.
73-
<14> Optional: Configure multiple outputs to forward logs to other external log aggregators of any supported type:
74-
** A name to describe the pipeline.
75-
** The `inputRefs` is the log type to forward by using the pipeline: `application,` `infrastructure`, or `audit`.
76-
** The `outputRefs` is the name of the output to use.
77-
** Optional: String. One or more labels to add to the logs.
7871

79-
. Create the CR object:
72+
. Apply the `ClusterLogForwarder` CR:
8073
+
8174
[source,terminal]
8275
----
83-
$ oc create -f <file-name>.yaml
76+
$ oc apply -f <filename>.yaml
8477
----
8578

8679
.Example: Setting a secret that contains a username and password
@@ -100,6 +93,7 @@ metadata:
10093
data:
10194
username: <username>
10295
password: <password>
96+
# ...
10397
----
10498

10599
. Create the secret:
@@ -124,16 +118,17 @@ spec:
124118
url: https://elasticsearch.secure.com:9200
125119
secret:
126120
name: openshift-test-secret
121+
# ...
127122
----
128123
+
129124
[NOTE]
130125
====
131126
In the value of the `url` field, the prefix can be `http` or `https`.
132127
====
133128

134-
. Create the CR object:
129+
. Apply the CR object:
135130
+
136131
[source,terminal]
137132
----
138-
$ oc create -f <file-name>.yaml
133+
$ oc apply -f <filename>.yaml
139134
----

0 commit comments

Comments
 (0)