From 050d10ed43dbd644502becdb85753928cb395327 Mon Sep 17 00:00:00 2001 From: robertaves Date: Wed, 17 Jun 2015 09:59:20 -0400 Subject: [PATCH] Update ElasticSearchReport.cs Check that you have \n after each line (last line needs it as well). --- Src/Metrics/ElasticSearch/ElasticSearchReport.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Metrics/ElasticSearch/ElasticSearchReport.cs b/Src/Metrics/ElasticSearch/ElasticSearchReport.cs index ac90ad8c..e3a28891 100644 --- a/Src/Metrics/ElasticSearch/ElasticSearchReport.cs +++ b/Src/Metrics/ElasticSearch/ElasticSearchReport.cs @@ -22,7 +22,7 @@ private class ESDocument public string ToJsonString() { var meta = string.Format("{{ \"index\" : {{ \"_index\" : \"{0}\", \"_type\" : \"{1}\"}} }}", this.Index, this.Type); - return meta + Environment.NewLine + this.Object.AsJson(false); + return meta + Environment.NewLine + this.Object.AsJson(false) + Environment.NewLine; } } @@ -46,7 +46,7 @@ protected override void EndReport(string contextName) base.EndReport(contextName); using (var client = new WebClient()) { - var json = string.Join(Environment.NewLine, this.data.Select(d => d.ToJsonString())); + var json = string.Join(string.Empty, this.data.Select(d => d.ToJsonString())); client.UploadString(this.elasticSearchUri, json); } }