From df51ab752c3694411e5bf6a6f0e89be2c7a21060 Mon Sep 17 00:00:00 2001 From: Parker Timmins Date: Fri, 7 Mar 2025 13:14:12 -0600 Subject: [PATCH] Set cause on create index request in create from action (#124363) In the create-index-from-source action, we should set the cause of the create index request so that it is clear in the logs. Without setting the cause on the request, the default value of api is used. --- docs/changelog/124363.yaml | 5 +++++ .../migrate/action/CreateIndexFromSourceTransportAction.java | 1 + 2 files changed, 6 insertions(+) create mode 100644 docs/changelog/124363.yaml diff --git a/docs/changelog/124363.yaml b/docs/changelog/124363.yaml new file mode 100644 index 0000000000000..3f278d02044a8 --- /dev/null +++ b/docs/changelog/124363.yaml @@ -0,0 +1,5 @@ +pr: 124363 +summary: Set cause on create index request in create from action +area: Data streams +type: enhancement +issues: [] diff --git a/x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/CreateIndexFromSourceTransportAction.java b/x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/CreateIndexFromSourceTransportAction.java index a12316129a4b5..0a897c6c1eb33 100644 --- a/x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/CreateIndexFromSourceTransportAction.java +++ b/x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/CreateIndexFromSourceTransportAction.java @@ -109,6 +109,7 @@ protected void doExecute(Task task, CreateIndexFromSourceAction.Request request, } var createIndexRequest = new CreateIndexRequest(request.destIndex()).settings(settings); + createIndexRequest.cause("create-index-from-source"); if (mergeMappings.isEmpty() == false) { createIndexRequest.mapping(mergeMappings); }