diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java index 1bf1f2487cd29..2a44eae988155 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java @@ -1195,7 +1195,7 @@ private void validateBulkResponses(int nbItems, boolean[] errors, BulkResponse b public void testUrlEncode() throws IOException { String indexPattern = ""; String expectedIndex = "logstash-" + - DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(DateTimeZone.UTC).monthOfYear().roundFloorCopy()); + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(DateTimeZone.UTC).monthOfYear().roundFloorCopy()); { IndexRequest indexRequest = new IndexRequest(indexPattern).id("id#1"); indexRequest.source("field", "value"); diff --git a/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc b/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc index 546057ab1a0b8..fcc0350a3e3bc 100644 --- a/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc +++ b/docs/painless/painless-contexts/painless-ingest-processor-context.asciidoc @@ -47,7 +47,7 @@ To run this example, first follow the steps in The seat data contains: -* A date in the format `YYYY-MM-DD` where the second digit of both month and day +* A date in the format `yyyy-MM-DD` where the second digit of both month and day is optional. * A time in the format HH:MM* where the second digit of both hours and minutes is optional. The star (*) represents either the `String` `AM` or `PM`. diff --git a/docs/reference/api-conventions.asciidoc b/docs/reference/api-conventions.asciidoc index 96a01bbeb5d9e..9e29797ea595d 100644 --- a/docs/reference/api-conventions.asciidoc +++ b/docs/reference/api-conventions.asciidoc @@ -82,7 +82,7 @@ Where: [horizontal] `static_name`:: is the static text part of the name `date_math_expr`:: is a dynamic date math expression that computes the date dynamically -`date_format`:: is the optional format in which the computed date should be rendered. Defaults to `YYYY.MM.dd`. +`date_format`:: is the optional format in which the computed date should be rendered. Defaults to `yyyy.MM.dd`. `time_zone`:: is the optional time zone . Defaults to `utc`. Date math expressions are resolved locale-independent. Consequently, it is not possible to use any other @@ -132,9 +132,9 @@ they resolve to given the current time is 22rd March 2024 noon utc. | Expression |Resolves to | `` | `logstash-2024.03.22` | `` | `logstash-2024.03.01` -| `` | `logstash-2024.03` -| `` | `logstash-2024.02` -| `` | `logstash-2024.03.23` +| `` | `logstash-2024.03` +| `` | `logstash-2024.02` +| `` | `logstash-2024.03.23` |====== To use the characters `{` and `}` in the static part of an index name template, escape them @@ -144,7 +144,7 @@ with a backslash `\`, for example: The following example shows a search request that searches the Logstash indices for the past three days, assuming the indices use the default Logstash index name format, -`logstash-YYYY.MM.dd`. +`logstash-yyyy.MM.dd`. [source,js] ---------------------------------------------------------------------- diff --git a/docs/reference/monitoring/http-export.asciidoc b/docs/reference/monitoring/http-export.asciidoc index fce22bd5d78be..9e96757b5573e 100644 --- a/docs/reference/monitoring/http-export.asciidoc +++ b/docs/reference/monitoring/http-export.asciidoc @@ -39,7 +39,7 @@ xpack.monitoring.exporters: headers: <7> My-Proxy-Header: abc123 My-Other-Thing: [ def456, ... ] - index.name.time_format: YYYY-MM <8> + index.name.time_format: yyyy-MM <8> ---------------------------------- <1> A `local` exporter defined explicitly whose arbitrary name is `my_local`. diff --git a/docs/reference/settings/monitoring-settings.asciidoc b/docs/reference/settings/monitoring-settings.asciidoc index c633088bc5ed4..b02cef600266d 100644 --- a/docs/reference/settings/monitoring-settings.asciidoc +++ b/docs/reference/settings/monitoring-settings.asciidoc @@ -240,7 +240,7 @@ anything defined here. `index.name.time_format`:: A mechanism for changing the default date suffix for the, by default, daily Monitoring indices. -The default value is `YYYY.MM.DD`, which is why the indices are created daily. +The default value is `yyyy.MM.DD`, which is why the indices are created daily. `use_ingest`:: diff --git a/docs/reference/sql/functions/date-time.asciidoc b/docs/reference/sql/functions/date-time.asciidoc index 15fdba39026ef..7e27228c94de9 100644 --- a/docs/reference/sql/functions/date-time.asciidoc +++ b/docs/reference/sql/functions/date-time.asciidoc @@ -23,7 +23,7 @@ The table below shows the mapping between {es} and {es-sql}: s|{es} s|{es-sql} 2+h| Index/Table datetime math -2+| +2+| 2+h| Query date/time math | 1y | INTERVAL 1 YEAR | 2M | INTERVAL 2 MONTH diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java index 354d92500904c..2972eb10dad1b 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java @@ -355,8 +355,8 @@ public void testUrlEncoder() { } public void testUrlEncoderWithParam() throws Exception { - assertScript("{{#url}}{{index}}{{/url}}", singletonMap("index", ""), - equalTo("%3Clogstash-%7Bnow%2Fd%7BYYYY.MM.dd%7C%2B12%3A00%7D%7D%3E")); + assertScript("{{#url}}{{index}}{{/url}}", singletonMap("index", ""), + equalTo("%3Clogstash-%7Bnow%2Fd%7Byyyy.MM.dd%7C%2B12%3A00%7D%7D%3E")); final String random = randomAlphaOfLength(10); assertScript("{{#url}}prefix_{{s}}{{/url}}", singletonMap("s", random), diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java index fe2bd6e9eed59..305621735e711 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java @@ -716,7 +716,7 @@ private static Mapper.Builder createBuilderFromDynamicValue(final ParseCont } else if (parseableAsLong == false && parseableAsDouble == false && context.root().dateDetection()) { // We refuse to match pure numbers, which are too likely to be // false positives with date formats that include eg. - // `epoch_millis` or `YYYY` + // `epoch_millis` or `yyyy` for (DateFormatter dateTimeFormatter : context.root().dynamicDateTimeFormatters()) { try { dateTimeFormatter.parse(text); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java index 9f6f19596d080..5875875ae0d96 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java @@ -276,7 +276,7 @@ public void testRolloverOnExistingIndex() throws Exception { public void testRolloverWithDateMath() { ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); assumeTrue("only works on the same day", now.plusMinutes(5).getDayOfYear() == now.getDayOfYear()); - String index = "test-" + DateFormatter.forPattern("YYYY.MM.dd").format(now) + "-1"; + String index = "test-" + DateFormatter.forPattern("yyyy.MM.dd").format(now) + "-1"; String dateMathExp = ""; assertAcked(prepareCreate(dateMathExp).addAlias(new Alias("test_alias")).get()); ensureGreen(index); @@ -284,34 +284,34 @@ public void testRolloverWithDateMath() { client().admin().indices().prepareClose(index).get(); client().admin().indices().prepareUpdateSettings(index).setSettings(Settings.builder() .put(IndexMetaData.SETTING_INDEX_PROVIDED_NAME, - "")).get(); + "")).get(); client().admin().indices().prepareOpen(index).get(); ensureGreen(index); RolloverResponse response = client().admin().indices().prepareRolloverIndex("test_alias").get(); assertThat(response.getOldIndex(), equalTo(index)); - assertThat(response.getNewIndex(), equalTo("test-" + DateFormatter.forPattern("YYYY.MM").format(now) + "-000002")); + assertThat(response.getNewIndex(), equalTo("test-" + DateFormatter.forPattern("yyyy.MM").format(now) + "-000002")); assertThat(response.isDryRun(), equalTo(false)); assertThat(response.isRolledOver(), equalTo(true)); assertThat(response.getConditionStatus().size(), equalTo(0)); response = client().admin().indices().prepareRolloverIndex("test_alias").get(); - assertThat(response.getOldIndex(), equalTo("test-" + DateFormatter.forPattern("YYYY.MM").format(now) + "-000002")); - assertThat(response.getNewIndex(), equalTo("test-" + DateFormatter.forPattern("YYYY.MM").format(now) + "-000003")); + assertThat(response.getOldIndex(), equalTo("test-" + DateFormatter.forPattern("yyyy.MM").format(now) + "-000002")); + assertThat(response.getNewIndex(), equalTo("test-" + DateFormatter.forPattern("yyyy.MM").format(now) + "-000003")); assertThat(response.isDryRun(), equalTo(false)); assertThat(response.isRolledOver(), equalTo(true)); assertThat(response.getConditionStatus().size(), equalTo(0)); GetSettingsResponse getSettingsResponse = client().admin().indices().prepareGetSettings(response.getOldIndex(), response.getNewIndex()).get(); - assertEquals("", getSettingsResponse.getSetting(response.getOldIndex(), + assertEquals("", getSettingsResponse.getSetting(response.getOldIndex(), IndexMetaData.SETTING_INDEX_PROVIDED_NAME)); - assertEquals("", getSettingsResponse.getSetting(response.getNewIndex(), + assertEquals("", getSettingsResponse.getSetting(response.getNewIndex(), IndexMetaData.SETTING_INDEX_PROVIDED_NAME)); response = client().admin().indices().prepareRolloverIndex("test_alias").setNewIndexName("").get(); - assertThat(response.getOldIndex(), equalTo("test-" + DateFormatter.forPattern("YYYY.MM").format(now) + "-000003")); - assertThat(response.getNewIndex(), equalTo("test-" + DateFormatter.forPattern("YYYY.MM.dd").format(now) + "-000004")); + assertThat(response.getOldIndex(), equalTo("test-" + DateFormatter.forPattern("yyyy.MM").format(now) + "-000003")); + assertThat(response.getNewIndex(), equalTo("test-" + DateFormatter.forPattern("yyyy.MM.dd").format(now) + "-000004")); assertThat(response.isDryRun(), equalTo(false)); assertThat(response.isRolledOver(), equalTo(true)); assertThat(response.getConditionStatus().size(), equalTo(0)); diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java index 2f52bd0d40aae..b130e753e57d8 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java @@ -64,11 +64,11 @@ public void testExpression() throws Exception { List result = expressionResolver.resolve(context, indexExpressions); assertThat(result.size(), equalTo(3)); assertThat(result.get(0), - equalTo(".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); assertThat(result.get(1), - equalTo(".watch_history-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".watch_history-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); assertThat(result.get(2), - equalTo("logstash-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo("logstash-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); } public void testEmpty() throws Exception { @@ -86,12 +86,11 @@ public void testExpression_MultiParts() throws Exception { List result = expressionResolver.resolve(context, Arrays.asList("<.text1-{now/d}-text2-{now/M}>")); assertThat(result.size(), equalTo(1)); assertThat(result.get(0), equalTo(".text1-" - + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)) + + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)) + "-text2-" - + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1)))); + + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1)))); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/37037") public void testExpression_CustomFormat() throws Exception { List results = expressionResolver.resolve(context, Arrays.asList("<.marvel-{now/d{yyyy.MM.dd}}>")); assertThat(results.size(), equalTo(1)); @@ -106,7 +105,6 @@ public void testExpression_EscapeStatic() throws Exception { equalTo(".mar{v}el-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/37037") public void testExpression_EscapeDateFormat() throws Exception { List result = expressionResolver.resolve(context, Arrays.asList("<.marvel-{now/d{'\\{year\\}'yyyy}}>")); assertThat(result.size(), equalTo(1)); @@ -116,18 +114,17 @@ public void testExpression_EscapeDateFormat() throws Exception { public void testExpression_MixedArray() throws Exception { List result = expressionResolver.resolve(context, Arrays.asList( - "name1", "<.marvel-{now/d}>", "name2", "<.logstash-{now/M{YYYY.MM}}>" + "name1", "<.marvel-{now/d}>", "name2", "<.logstash-{now/M{yyyy.MM}}>" )); assertThat(result.size(), equalTo(4)); assertThat(result.get(0), equalTo("name1")); assertThat(result.get(1), - equalTo(".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); assertThat(result.get(2), equalTo("name2")); assertThat(result.get(3), equalTo(".logstash-" + - DateTimeFormat.forPattern("YYYY.MM").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1)))); + DateTimeFormat.forPattern("yyyy.MM").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1)))); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/37037") public void testExpression_CustomTimeZoneInIndexName() throws Exception { DateTimeZone timeZone; int hoursOffset; diff --git a/server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java b/server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java index e49f25772a726..430ec166a0679 100644 --- a/server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java +++ b/server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java @@ -662,7 +662,7 @@ public void testsTimeZoneParsing() { // Formatter used to print and parse the sample date. // Printing the date works but parsing it back fails // with Joda 2.9.4 - DateTimeFormatter formatter = DateTimeFormat.forPattern("YYYY-MM-dd'T'HH:mm:ss " + randomFrom("ZZZ", "[ZZZ]", "'['ZZZ']'")); + DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss " + randomFrom("ZZZ", "[ZZZ]", "'['ZZZ']'")); String dateTimeAsString = formatter.print(expected); assertThat(dateTimeAsString, startsWith("2016-11-10T05:37:59 ")); diff --git a/server/src/test/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java b/server/src/test/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java index fe4ab2e363a88..7f610095cfbba 100644 --- a/server/src/test/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java +++ b/server/src/test/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java @@ -44,9 +44,9 @@ public class DateMathIndexExpressionsIntegrationIT extends ESIntegTestCase { public void testIndexNameDateMathExpressions() { DateTime now = new DateTime(DateTimeZone.UTC); - String index1 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now); - String index2 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now.minusDays(1)); - String index3 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now.minusDays(2)); + String index1 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now); + String index2 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now.minusDays(1)); + String index3 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now.minusDays(2)); createIndex(index1, index2, index3); GetSettingsResponse getSettingsResponse = client().admin().indices().prepareGetSettings(index1, index2, index3).get(); @@ -110,9 +110,9 @@ public void testIndexNameDateMathExpressions() { public void testAutoCreateIndexWithDateMathExpression() throws Exception { DateTime now = new DateTime(DateTimeZone.UTC); - String index1 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now); - String index2 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now.minusDays(1)); - String index3 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now.minusDays(2)); + String index1 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now); + String index2 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now.minusDays(1)); + String index3 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now.minusDays(2)); String dateMathExp1 = "<.marvel-{now/d}>"; String dateMathExp2 = "<.marvel-{now/d-1d}>"; @@ -134,9 +134,9 @@ public void testAutoCreateIndexWithDateMathExpression() throws Exception { public void testCreateIndexWithDateMathExpression() throws Exception { DateTime now = new DateTime(DateTimeZone.UTC); - String index1 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now); - String index2 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now.minusDays(1)); - String index3 = ".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(now.minusDays(2)); + String index1 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now); + String index2 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now.minusDays(1)); + String index3 = ".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now.minusDays(2)); String dateMathExp1 = "<.marvel-{now/d}>"; String dateMathExp2 = "<.marvel-{now/d-1d}>"; diff --git a/server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java b/server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java index 4750ee36b0bd6..b1b4e1d55368c 100644 --- a/server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java +++ b/server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java @@ -232,8 +232,8 @@ public void testYearOfEra() { } public void testToString1() { - assertMethodDeprecation(() -> assertThat(javaTime.toString("YYYY/MM/dd HH:mm:ss.SSS"), - equalTo(jodaTime.toString("YYYY/MM/dd HH:mm:ss.SSS"))), "toString(String)", "a DateTimeFormatter"); + assertMethodDeprecation(() -> assertThat(javaTime.toString("yyyy/MM/dd HH:mm:ss.SSS"), + equalTo(jodaTime.toString("yyyy/MM/dd HH:mm:ss.SSS"))), "toString(String)", "a DateTimeFormatter"); } public void testToString2() { diff --git a/x-pack/docs/en/watcher/release-notes.asciidoc b/x-pack/docs/en/watcher/release-notes.asciidoc index 5875458a15433..bdc617fe06137 100644 --- a/x-pack/docs/en/watcher/release-notes.asciidoc +++ b/x-pack/docs/en/watcher/release-notes.asciidoc @@ -201,7 +201,7 @@ October 28, 2015 they did before the upgrade. For example if `watcher.dynamic_indices.time_zone` setting was set to `+01:00` and a watch has the following index name `` then after the upgrade you need to update this watch to - use the following index name ``. + use the following index name ``. .New Features * Added new <> diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java index 607b49be1f453..48b3ad44f863f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java @@ -200,7 +200,7 @@ */ public class Cron implements ToXContentFragment { protected static final TimeZone UTC = DateTimeZone.UTC.toTimeZone(); - protected static final DateTimeFormatter formatter = DateTimeFormat.forPattern("YYYY-MM-dd'T'HH:mm:ss"); + protected static final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss"); private static final int SECOND = 0; private static final int MINUTE = 1; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java index 34c069adb2a02..6e0256225cf57 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java @@ -70,7 +70,7 @@ public abstract class Exporter implements AutoCloseable { Setting.affixKeySetting("xpack.monitoring.exporters.","index.name.time_format", key -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope)); - private static final String INDEX_FORMAT = "YYYY.MM.dd"; + private static final String INDEX_FORMAT = "yyyy.MM.dd"; protected final Config config; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java index 6caefe148b28a..df2f7ba698f09 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java @@ -256,7 +256,7 @@ private void checkMonitoringDocs() { .get("xpack.monitoring.exporters._local.index.name.time_format"); assertEquals(indexTimeFormat, customTimeFormat); if (customTimeFormat == null) { - customTimeFormat = "YYYY.MM.dd"; + customTimeFormat = "yyyy.MM.dd"; } DateTimeFormatter dateParser = ISODateTimeFormat.dateTime().withZoneUTC(); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java index 171e11614c5f3..3aebe74ef5427 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java @@ -1155,12 +1155,12 @@ public void testAuthorizationOfIndividualBulkItems() { public void testAuthorizationOfIndividualBulkItemsWithDateMath() { final String action = BulkAction.NAME + "[s]"; final BulkItemRequest[] items = { - new BulkItemRequest(1, new IndexRequest("", "doc", "dy1")), + new BulkItemRequest(1, new IndexRequest("", "doc", "dy1")), new BulkItemRequest(2, - new DeleteRequest("", "doc", "dy2")), // resolves to same as above - new BulkItemRequest(3, new IndexRequest("", "doc", "dm1")), + new DeleteRequest("", "doc", "dy2")), // resolves to same as above + new BulkItemRequest(3, new IndexRequest("", "doc", "dm1")), new BulkItemRequest(4, - new DeleteRequest("", "doc", "dm2")), // resolves to same as above + new DeleteRequest("", "doc", "dm2")), // resolves to same as above }; final ShardId shardId = new ShardId("concrete-index", UUID.randomUUID().toString(), 1); final TransportRequest request = new BulkShardRequest(shardId, WriteRequest.RefreshPolicy.IMMEDIATE, items); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java index 2a1619655b315..8777a66d41e7c 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java @@ -1277,7 +1277,7 @@ public void testUnauthorizedDateMathExpressionIgnoreUnavailableDisallowNoIndices } public void testUnauthorizedDateMathExpressionStrict() { - String expectedIndex = "datetime-" + DateTimeFormat.forPattern("YYYY.MM.dd").print( + String expectedIndex = "datetime-" + DateTimeFormat.forPattern("yyyy.MM.dd").print( new DateTime(DateTimeZone.UTC).monthOfYear().roundFloorCopy()); SearchRequest request = new SearchRequest(""); request.indicesOptions(IndicesOptions.fromOptions(false, randomBoolean(), randomBoolean(), randomBoolean())); @@ -1319,7 +1319,7 @@ public void testMissingDateMathExpressionIgnoreUnavailableDisallowNoIndices() { } public void testMissingDateMathExpressionStrict() { - String expectedIndex = "foobar-" + DateTimeFormat.forPattern("YYYY.MM.dd").print( + String expectedIndex = "foobar-" + DateTimeFormat.forPattern("yyyy.MM.dd").print( new DateTime(DateTimeZone.UTC).monthOfYear().roundFloorCopy()); SearchRequest request = new SearchRequest(""); request.indicesOptions(IndicesOptions.fromOptions(false, randomBoolean(), randomBoolean(), randomBoolean())); diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/security/authz/13_index_datemath.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/security/authz/13_index_datemath.yml index 462b023d18cc0..f1f40ec748abe 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/security/authz/13_index_datemath.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/security/authz/13_index_datemath.yml @@ -57,7 +57,7 @@ teardown: headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user bulk: body: - - '{"index": {"_index": "", "_id": "2"}}' + - '{"index": {"_index": "", "_id": "2"}}' - '{"name": "doc2"}' - '{"index": {"_index": "", "_id": "3"}}' - '{"name": "doc3"}' @@ -92,7 +92,7 @@ teardown: headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user bulk: body: - - '{"index": {"_index": "", "_id": "5"}}' + - '{"index": {"_index": "", "_id": "5"}}' - '{"name": "doc5"}' - '{"index": {"_index": "", "_id": "6"}}' - '{"name": "doc6"}' @@ -118,9 +118,9 @@ teardown: headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user bulk: body: - - '{"index": {"_index": "", "_id": "7"}}' + - '{"index": {"_index": "", "_id": "7"}}' - '{"name": "doc7"}' - - '{"index": {"_index": "", "_id": "8"}}' + - '{"index": {"_index": "", "_id": "8"}}' - '{"name": "doc8"}' - match: { errors: true } - match: { items.0.index.status: 403 } diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java index d5eea54a80c85..f8c4630d7dbe7 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java @@ -645,7 +645,7 @@ static void validAutoCreateIndex(Settings settings, Logger logger) { logger.warn("the [action.auto_create_index] setting is configured to be restrictive [{}]. " + " for the next 6 months daily history indices are allowed to be created, but please make sure" + " that any future history indices after 6 months with the pattern " + - "[.watcher-history-YYYY.MM.dd] are allowed to be created", value); + "[.watcher-history-yyyy.MM.dd] are allowed to be created", value); } // These are all old templates from pre 6.0 era, that need to be deleted diff --git a/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle b/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle index 57be337f634f2..d4bf1f836b8b0 100644 --- a/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle +++ b/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle @@ -18,10 +18,10 @@ integTestCluster { // exporter settings are configured dynamically in our tests // configure a local exporter, the HTTP exporter is configured via dynamic settings change //setting 'xpack.monitoring.exporters.my_local.type', 'local' - //setting 'xpack.monitoring.exporters.my_local.index.name.time_format', 'YYYY' + //setting 'xpack.monitoring.exporters.my_local.index.name.time_format', 'yyyy' //setting 'xpack.monitoring.exporters.my_http.type', 'http' //setting 'xpack.monitoring.exporters.my_http.host', 'http' - //setting 'xpack.monitoring.exporters.my_http.index.name.time_format', 'YYYY-MM' + //setting 'xpack.monitoring.exporters.my_http.index.name.time_format', 'yyyy-MM' // one of the exporters should configure cluster alerts // setting 'xpack.monitoring.exporters.my_http.cluster_alerts.management.enabled', 'true' }