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
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.
9
9
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:
12
13
13
14
* The index is older than the `rollover.maxAge` value in the `Elasticsearch` CR.
14
15
* The index size is greater than 40 GB × the number of primary shards.
15
16
* The index doc count is greater than 40960 KB × the number of primary shards.
16
17
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.
31
19
32
20
.Prerequisites
33
21
34
-
* OpenShift Logging and Elasticsearch must be installed.
22
+
* OpenShift Logging and the OpenShift Elasticsearch Operator must be installed.
35
23
36
24
.Procedure
37
25
@@ -59,18 +47,11 @@ spec:
59
47
nodeCount: 3
60
48
...
61
49
----
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.
66
51
67
52
. You can verify the settings in the `Elasticsearch` custom resource (CR).
68
53
+
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.
74
55
+
75
56
[source,yaml]
76
57
----
@@ -93,23 +74,17 @@ spec:
93
74
pollInterval: 15m <4>
94
75
...
95
76
----
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.
104
81
+
105
82
[NOTE]
106
83
====
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.
109
85
====
110
86
+
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`.
0 commit comments