Skip to content

Commit

Permalink
[8.15] Rename logs index mode to logsdb (#111054) (#111098)
Browse files Browse the repository at this point in the history
  • Loading branch information
salvatore-campagna committed Jul 19, 2024
1 parent bdb1028 commit aecc6e2
Show file tree
Hide file tree
Showing 18 changed files with 130 additions and 128 deletions.
6 changes: 3 additions & 3 deletions docs/reference/data-streams/logs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[logs-data-stream]]
== Logs data stream

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.]
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.]

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

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

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

[source,console]
----
Expand All @@ -30,7 +30,7 @@ PUT _index_template/my-index-template
"data_stream": { },
"template": {
"settings": {
"index.mode": "logs" <1>
"index.mode": "logsdb" <1>
}
},
"priority": 101 <2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void testLogsIndexModeDataStreamIndexing() throws IOException, ExecutionE
client(),
"logs-composable-template",
LOGS_OR_STANDARD_MAPPING,
Map.of("index.mode", "logs"),
Map.of("index.mode", "logsdb"),
List.of("logs-*-*")
);
final String dataStreamName = generateDataStreamName("logs");
Expand All @@ -188,7 +188,7 @@ public void testIndexModeLogsAndStandardSwitching() throws IOException, Executio
);
createDataStream(client(), dataStreamName);
for (int i = 0; i < randomIntBetween(5, 10); i++) {
final IndexMode indexMode = i % 2 == 0 ? IndexMode.LOGS : IndexMode.STANDARD;
final IndexMode indexMode = i % 2 == 0 ? IndexMode.LOGSDB : IndexMode.STANDARD;
indexModes.add(indexMode);
updateComposableIndexTemplate(
client(),
Expand All @@ -206,7 +206,7 @@ public void testIndexModeLogsAndStandardSwitching() throws IOException, Executio
public void testIndexModeLogsAndTimeSeriesSwitching() throws IOException, ExecutionException, InterruptedException {
final String dataStreamName = generateDataStreamName("custom");
final List<String> indexPatterns = List.of("custom-*-*");
final Map<String, String> logsSettings = Map.of("index.mode", "logs");
final Map<String, String> logsSettings = Map.of("index.mode", "logsdb");
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series", "index.routing_path", "host.name");

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

assertDataStreamBackingIndicesModes(dataStreamName, List.of(IndexMode.LOGS, IndexMode.TIME_SERIES, IndexMode.LOGS));
assertDataStreamBackingIndicesModes(dataStreamName, List.of(IndexMode.LOGSDB, IndexMode.TIME_SERIES, IndexMode.LOGSDB));
}

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

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

putComposableIndexTemplate(client(), "custom-composable-template", LOGS_OR_STANDARD_MAPPING, logsSettings, indexPatterns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static void waitForLogs(RestClient client) throws Exception {
"template": {
"settings": {
"index": {
"mode": "logs"
"mode": "logsdb"
}
},
"mappings": {
Expand Down Expand Up @@ -161,7 +161,7 @@ public void testLogsIndexing() throws IOException {
randomIp(randomBoolean())
)
);
assertDataStreamBackingIndexMode("logs", 0);
assertDataStreamBackingIndexMode("logsdb", 0);
rolloverDataStream(client, DATA_STREAM_NAME);
indexDocument(
client,
Expand All @@ -175,7 +175,7 @@ public void testLogsIndexing() throws IOException {
randomIp(randomBoolean())
)
);
assertDataStreamBackingIndexMode("logs", 1);
assertDataStreamBackingIndexMode("logsdb", 1);
}

public void testLogsStandardIndexModeSwitch() throws IOException {
Expand All @@ -193,7 +193,7 @@ public void testLogsStandardIndexModeSwitch() throws IOException {
randomIp(randomBoolean())
)
);
assertDataStreamBackingIndexMode("logs", 0);
assertDataStreamBackingIndexMode("logsdb", 0);

putTemplate(client, "custom-template", STANDARD_TEMPLATE);
rolloverDataStream(client, DATA_STREAM_NAME);
Expand Down Expand Up @@ -225,7 +225,7 @@ public void testLogsStandardIndexModeSwitch() throws IOException {
randomIp(randomBoolean())
)
);
assertDataStreamBackingIndexMode("logs", 2);
assertDataStreamBackingIndexMode("logsdb", 2);
}

private void assertDataStreamBackingIndexMode(final String indexMode, int backingIndex) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void setup() throws Exception {
public void testLogsSettingsIndexModeDisabled() throws IOException {
assertOK(createDataStream(client, "logs-custom-dev"));
final String indexMode = (String) getSetting(client, getDataStreamBackingIndex(client, "logs-custom-dev", 0), "index.mode");
assertThat(indexMode, Matchers.not(equalTo(IndexMode.LOGS.getName())));
assertThat(indexMode, Matchers.not(equalTo(IndexMode.LOGSDB.getName())));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void testCreateDataStream() throws IOException {
assertOK(putComponentTemplate(client, "logs@custom", MAPPINGS));
assertOK(createDataStream(client, "logs-custom-dev"));
final String indexMode = (String) getSetting(client, getDataStreamBackingIndex(client, "logs-custom-dev", 0), "index.mode");
assertThat(indexMode, equalTo(IndexMode.LOGS.getName()));
assertThat(indexMode, equalTo(IndexMode.LOGSDB.getName()));
}

public void testBulkIndexing() throws IOException {
Expand Down
Loading

0 comments on commit aecc6e2

Please sign in to comment.