Skip to content

Commit dfe3d8e

Browse files
committed
RHDEVDOCS-3285 Tracker for 1988271 ClusterLogging retentionPolicy doesn't work as documented
1 parent b8c3111 commit dfe3d8e

File tree

1 file changed

+14
-39
lines changed

1 file changed

+14
-39
lines changed

modules/cluster-logging-elasticsearch-retention.adoc

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,21 @@
55
[id="cluster-logging-elasticsearch-retention_{context}"]
66
= Configuring log retention time
77

8-
You can specify how long the default Elasticsearch log store keeps indices using a separate _retention policy_ for each of the three log sources: infrastructure logs, application logs, and audit logs. The retention policy, which you configure using the `maxAge` parameter in the Cluster Logging custom resource (CR), is considered for the Elasticsearch roll over schedule and determines when Elasticsearch deletes the rolled-over indices.
8+
You can configure a _retention policy_ that specifies how long the default Elasticsearch log store keeps indices for each of the three log sources: infrastructure logs, application logs, and audit logs.
99

10-
Elasticsearch rolls over an index, moving the current index and creating a new
11-
index, when an index matches any of the following conditions:
10+
To configure the retention policy, you set a `maxAge` parameter for each log source in the `ClusterLogging` custom resource (CR). The CR applies these values to the Elasticsearch rollover schedule, which determines when Elasticsearch deletes the rolled-over indices.
11+
12+
Elasticsearch rolls over an index, moving the current index and creating a new index, when an index matches any of the following conditions:
1213

1314
* The index is older than the `rollover.maxAge` value in the `Elasticsearch` CR.
1415
* The index size is greater than 40 GB × the number of primary shards.
1516
* The index doc count is greater than 40960 KB × the number of primary shards.
1617

17-
Elasticsearch deletes the rolled-over indices are deleted based on the
18-
retention policy you configure.
19-
20-
If you do not create a retention policy for any of the log sources, logs
21-
are deleted after seven days by default.
22-
23-
[IMPORTANT]
24-
====
25-
If you do not specify a retention policy for all three log sources, only logs
26-
from the sources with a retention policy are stored. For example, if you
27-
set a retention policy for the infrastructure and applicaiton logs, but do not
28-
set a retention policy for audit logs, the audit logs will not be retained
29-
and there will be no *audit-* index in Elasticsearch or Kibana.
30-
====
18+
Elasticsearch deletes the rolled-over indices based on the retention policy you configure. If you do not create a retention policy for any log sources, logs are deleted after seven days by default.
3119

3220
.Prerequisites
3321

34-
* OpenShift Logging and Elasticsearch must be installed.
22+
* OpenShift Logging and the OpenShift Elasticsearch Operator must be installed.
3523

3624
.Procedure
3725

@@ -59,18 +47,11 @@ spec:
5947
nodeCount: 3
6048
...
6149
----
62-
<1> Specify the time that Elasticsearch should retain each log source. Enter an
63-
integer and a time designation: weeks(w), hours(h/H), minutes(m) and seconds(s).
64-
For example, `1d` for one day. Logs older than the `maxAge` are deleted.
65-
By default, logs are retained for seven days.
50+
<1> Specify the time that Elasticsearch should retain each log source. Enter an integer and a time designation: weeks(w), hours(h/H), minutes(m) and seconds(s). For example, `1d` for one day. Logs older than the `maxAge` are deleted. By default, logs are retained for seven days.
6651

6752
. You can verify the settings in the `Elasticsearch` custom resource (CR).
6853
+
69-
For example, the Red Hat OpenShift Logging Operator updated the following
70-
`Elasticsearch` CR to configure a retention policy that includes settings
71-
to roll over active indices for the infrastructure logs every eight hours and
72-
the rolled-ver indices are deleted seven days after rollover. {product-title} checks
73-
every 15 minutes to determine if the indices need to be rolled over.
54+
For example, the Red Hat OpenShift Logging Operator updated the following `Elasticsearch` CR to configure a retention policy that includes settings to roll over active indices for the infrastructure logs every eight hours and the rolled-over indices are deleted seven days after rollover. {product-title} checks every 15 minutes to determine if the indices need to be rolled over.
7455
+
7556
[source,yaml]
7657
----
@@ -93,23 +74,17 @@ spec:
9374
pollInterval: 15m <4>
9475
...
9576
----
96-
<1> For each log source, the retention policy indicates when to delete and
97-
rollover logs for that source.
98-
<2> When {product-title} deletes the rolled-over indices. This setting
99-
is the `maxAge` you set in the `ClusterLogging` CR.
100-
<3> The index age for {product-title} to consider when rolling over the indices.
101-
This value is determined from the `maxAge` you set in the `ClusterLogging` CR.
102-
<4> When {product-title} checks if the indices should be rolled over.
103-
This setting is the default and cannot be changed.
77+
<1> For each log source, the retention policy indicates when to delete and roll over logs for that source.
78+
<2> When {product-title} deletes the rolled-over indices. This setting is the `maxAge` you set in the `ClusterLogging` CR.
79+
<3> The index age for {product-title} to consider when rolling over the indices. This value is determined from the `maxAge` you set in the `ClusterLogging` CR.
80+
<4> When {product-title} checks if the indices should be rolled over. This setting is the default and cannot be changed.
10481
+
10582
[NOTE]
10683
====
107-
Modifying the `Elasticsearch` CR is not supported. All changes to the retention
108-
policies must be made in the `ClusterLogging` CR.
84+
Modifying the `Elasticsearch` CR is not supported. All changes to the retention policies must be made in the `ClusterLogging` CR.
10985
====
11086
+
111-
The OpenShift Elasticsearch Operator deploys a cron job to roll over indices for each
112-
mapping using the defined policy, scheduled using the `pollInterval`.
87+
The OpenShift Elasticsearch Operator deploys a cron job to roll over indices for each mapping using the defined policy, scheduled using the `pollInterval`.
11388
+
11489
[source,terminal]
11590
----

0 commit comments

Comments
 (0)