From 2d339a90065a24c107bc74e78e6f3a9f3e1dd4fd Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Sat, 15 Nov 2014 18:09:29 +0100 Subject: [PATCH] ESExporter - Specify index in url and not per index entry to allow indexing when `rest.action.multi.allow_explicit_index: false` is set. Closes #361 --- .../org/elasticsearch/marvel/agent/exporter/ESExporter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/ESExporter.java b/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/ESExporter.java index f6ed34e7b25ae..8ad5efb613b0e 100644 --- a/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/ESExporter.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/ESExporter.java @@ -218,7 +218,7 @@ public void exportClusterStats(ClusterStatsResponse clusterStats) { private HttpURLConnection openExportingConnection() { logger.trace("setting up an export connection"); - HttpURLConnection conn = openAndValidateConnection("POST", "_bulk", XContentType.SMILE.restContentType()); + HttpURLConnection conn = openAndValidateConnection("POST", getIndexName() + "/_bulk", XContentType.SMILE.restContentType()); if (conn != null && (keepAliveThread == null || !keepAliveThread.isAlive())) { // start keep alive upon successful connection if not there. initKeepAliveThread(); @@ -233,7 +233,6 @@ private void addXContentRendererToConnection(HttpURLConnection conn, for (int i = 0; i < renderer.length(); i++) { XContentBuilder builder = XContentFactory.smileBuilder(); builder.startObject().startObject("index") - .field("_index", getIndexName()) .field("_type", renderer.type(i)) .endObject().endObject(); builder.close();