diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/SnapshotLifecyclePolicyItem.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/SnapshotLifecyclePolicyItem.java index c76a205f36265..62d2289cf2eee 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/SnapshotLifecyclePolicyItem.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/SnapshotLifecyclePolicyItem.java @@ -113,7 +113,7 @@ public boolean equals(Object obj) { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(policy.getId()); builder.field("version", version); - builder.field("modified_date", modifiedDate); + builder.timeField("modified_date_millis", "modified_date", modifiedDate); builder.field("policy", policy); if (lastSuccess != null) { builder.field("last_success", lastSuccess); diff --git a/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/snapshotlifecycle/SnapshotLifecycleIT.java b/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/snapshotlifecycle/SnapshotLifecycleIT.java index 668736b7f5327..2436a481421f0 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/snapshotlifecycle/SnapshotLifecycleIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/snapshotlifecycle/SnapshotLifecycleIT.java @@ -93,7 +93,7 @@ public void testFullPolicySnapshot() throws Exception { Map lastSuccessObject = (Map) policyMetadataMap.get("last_success"); assertNotNull(lastSuccessObject); Long lastSuccess = (Long) lastSuccessObject.get("time"); - Long modifiedDate = (Long) policyMetadataMap.get("modified_date"); + Long modifiedDate = (Long) policyMetadataMap.get("modified_date_millis"); assertNotNull(lastSuccess); assertNotNull(modifiedDate); assertThat(lastSuccess, greaterThan(modifiedDate)); @@ -133,7 +133,7 @@ public void testPolicyFailure() throws Exception { assertNotNull(lastFailureObject); Long lastFailure = (Long) lastFailureObject.get("time"); - Long modifiedDate = (Long) policyMetadataMap.get("modified_date"); + Long modifiedDate = (Long) policyMetadataMap.get("modified_date_millis"); assertNotNull(lastFailure); assertNotNull(modifiedDate); assertThat(lastFailure, greaterThan(modifiedDate));