Skip to content

Commit 0f58417

Browse files
Rename logs index mode to logsdb (elastic#111054)
1 parent cd80b3a commit 0f58417

File tree

21 files changed

+110
-108
lines changed

21 files changed

+110
-108
lines changed

docs/reference/data-streams/logs.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[logs-data-stream]]
22
== Logs data stream
33

4-
preview::[Logs data streams and the logs index mode are in tech preview and may be changed or removed in the future. Don't use logs data streams or logs index mode in production.]
4+
preview::[Logs data streams and the logsdb index mode are in tech preview and may be changed or removed in the future. Don't use logs data streams or logsdb index mode in production.]
55

66
A logs data stream is a data stream type that stores log data more efficiently.
77

@@ -20,7 +20,7 @@ The following features are enabled in a logs data stream:
2020
[[how-to-use-logsds]]
2121
=== Create a logs data stream
2222

23-
To create a logs data stream, set your index template `index.mode` to `logs`:
23+
To create a logs data stream, set your index template `index.mode` to `logsdb`:
2424

2525
[source,console]
2626
----
@@ -30,7 +30,7 @@ PUT _index_template/my-index-template
3030
"data_stream": { },
3131
"template": {
3232
"settings": {
33-
"index.mode": "logs" <1>
33+
"index.mode": "logsdb" <1>
3434
}
3535
},
3636
"priority": 101 <2>

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/LogsDataStreamIT.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void testLogsIndexModeDataStreamIndexing() throws IOException, ExecutionE
165165
client(),
166166
"logs-composable-template",
167167
LOGS_OR_STANDARD_MAPPING,
168-
Map.of("index.mode", "logs"),
168+
Map.of("index.mode", "logsdb"),
169169
List.of("logs-*-*")
170170
);
171171
final String dataStreamName = generateDataStreamName("logs");
@@ -188,7 +188,7 @@ public void testIndexModeLogsAndStandardSwitching() throws IOException, Executio
188188
);
189189
createDataStream(client(), dataStreamName);
190190
for (int i = 0; i < randomIntBetween(5, 10); i++) {
191-
final IndexMode indexMode = i % 2 == 0 ? IndexMode.LOGS : IndexMode.STANDARD;
191+
final IndexMode indexMode = i % 2 == 0 ? IndexMode.LOGSDB : IndexMode.STANDARD;
192192
indexModes.add(indexMode);
193193
updateComposableIndexTemplate(
194194
client(),
@@ -206,7 +206,7 @@ public void testIndexModeLogsAndStandardSwitching() throws IOException, Executio
206206
public void testIndexModeLogsAndTimeSeriesSwitching() throws IOException, ExecutionException, InterruptedException {
207207
final String dataStreamName = generateDataStreamName("custom");
208208
final List<String> indexPatterns = List.of("custom-*-*");
209-
final Map<String, String> logsSettings = Map.of("index.mode", "logs");
209+
final Map<String, String> logsSettings = Map.of("index.mode", "logsdb");
210210
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series", "index.routing_path", "host.name");
211211

212212
putComposableIndexTemplate(client(), "custom-composable-template", LOGS_OR_STANDARD_MAPPING, logsSettings, indexPatterns);
@@ -221,13 +221,13 @@ public void testIndexModeLogsAndTimeSeriesSwitching() throws IOException, Execut
221221
rolloverDataStream(dataStreamName);
222222
indexLogOrStandardDocuments(client(), randomIntBetween(10, 20), randomIntBetween(32, 64), dataStreamName);
223223

224-
assertDataStreamBackingIndicesModes(dataStreamName, List.of(IndexMode.LOGS, IndexMode.TIME_SERIES, IndexMode.LOGS));
224+
assertDataStreamBackingIndicesModes(dataStreamName, List.of(IndexMode.LOGSDB, IndexMode.TIME_SERIES, IndexMode.LOGSDB));
225225
}
226226

227227
public void testInvalidIndexModeTimeSeriesSwitchWithoutRoutingPath() throws IOException, ExecutionException, InterruptedException {
228228
final String dataStreamName = generateDataStreamName("custom");
229229
final List<String> indexPatterns = List.of("custom-*-*");
230-
final Map<String, String> logsSettings = Map.of("index.mode", "logs");
230+
final Map<String, String> logsSettings = Map.of("index.mode", "logsdb");
231231
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series");
232232

233233
putComposableIndexTemplate(client(), "custom-composable-template", LOGS_OR_STANDARD_MAPPING, logsSettings, indexPatterns);
@@ -249,7 +249,7 @@ public void testInvalidIndexModeTimeSeriesSwitchWithoutRoutingPath() throws IOEx
249249
public void testInvalidIndexModeTimeSeriesSwitchWithoutDimensions() throws IOException, ExecutionException, InterruptedException {
250250
final String dataStreamName = generateDataStreamName("custom");
251251
final List<String> indexPatterns = List.of("custom-*-*");
252-
final Map<String, String> logsSettings = Map.of("index.mode", "logs");
252+
final Map<String, String> logsSettings = Map.of("index.mode", "logsdb");
253253
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series", "index.routing_path", "host.name");
254254

255255
putComposableIndexTemplate(client(), "custom-composable-template", LOGS_OR_STANDARD_MAPPING, logsSettings, indexPatterns);

modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/LogsDataStreamRestIT.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static void waitForLogs(RestClient client) throws Exception {
7272
"template": {
7373
"settings": {
7474
"index": {
75-
"mode": "logs"
75+
"mode": "logsdb"
7676
}
7777
},
7878
"mappings": {
@@ -161,7 +161,7 @@ public void testLogsIndexing() throws IOException {
161161
randomIp(randomBoolean())
162162
)
163163
);
164-
assertDataStreamBackingIndexMode("logs", 0);
164+
assertDataStreamBackingIndexMode("logsdb", 0);
165165
rolloverDataStream(client, DATA_STREAM_NAME);
166166
indexDocument(
167167
client,
@@ -175,7 +175,7 @@ public void testLogsIndexing() throws IOException {
175175
randomIp(randomBoolean())
176176
)
177177
);
178-
assertDataStreamBackingIndexMode("logs", 1);
178+
assertDataStreamBackingIndexMode("logsdb", 1);
179179
}
180180

181181
public void testLogsStandardIndexModeSwitch() throws IOException {
@@ -193,7 +193,7 @@ public void testLogsStandardIndexModeSwitch() throws IOException {
193193
randomIp(randomBoolean())
194194
)
195195
);
196-
assertDataStreamBackingIndexMode("logs", 0);
196+
assertDataStreamBackingIndexMode("logsdb", 0);
197197

198198
putTemplate(client, "custom-template", STANDARD_TEMPLATE);
199199
rolloverDataStream(client, DATA_STREAM_NAME);
@@ -225,7 +225,7 @@ public void testLogsStandardIndexModeSwitch() throws IOException {
225225
randomIp(randomBoolean())
226226
)
227227
);
228-
assertDataStreamBackingIndexMode("logs", 2);
228+
assertDataStreamBackingIndexMode("logsdb", 2);
229229
}
230230

231231
private void assertDataStreamBackingIndexMode(final String indexMode, int backingIndex) throws IOException {

modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/logsdb/LogsIndexModeDisabledRestTestIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void setup() throws Exception {
5050
public void testLogsSettingsIndexModeDisabled() throws IOException {
5151
assertOK(createDataStream(client, "logs-custom-dev"));
5252
final String indexMode = (String) getSetting(client, getDataStreamBackingIndex(client, "logs-custom-dev", 0), "index.mode");
53-
assertThat(indexMode, Matchers.not(equalTo(IndexMode.LOGS.getName())));
53+
assertThat(indexMode, Matchers.not(equalTo(IndexMode.LOGSDB.getName())));
5454
}
5555

5656
}

modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/logsdb/LogsIndexModeEnabledRestTestIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void testCreateDataStream() throws IOException {
179179
assertOK(putComponentTemplate(client, "logs@custom", MAPPINGS));
180180
assertOK(createDataStream(client, "logs-custom-dev"));
181181
final String indexMode = (String) getSetting(client, getDataStreamBackingIndex(client, "logs-custom-dev", 0), "index.mode");
182-
assertThat(indexMode, equalTo(IndexMode.LOGS.getName()));
182+
assertThat(indexMode, equalTo(IndexMode.LOGSDB.getName()));
183183
}
184184

185185
public void testBulkIndexing() throws IOException {

modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/logsdb/qa/StandardVersusLogsIndexModeChallengeRestIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private static void settings(final Settings.Builder settings) {
9999

100100
@Override
101101
public void contenderSettings(Settings.Builder builder) {
102-
builder.put("index.mode", "logs");
102+
builder.put("index.mode", "logsdb");
103103
settings(builder);
104104
}
105105

0 commit comments

Comments
 (0)