From 527532d56fad4a85441277e7834a6267a968d0d1 Mon Sep 17 00:00:00 2001 From: Brad Reed Date: Tue, 22 Oct 2024 12:36:37 +0100 Subject: [PATCH] split --- metrics/src/logreceiver.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metrics/src/logreceiver.rs b/metrics/src/logreceiver.rs index b6b8c15..1c0459c 100644 --- a/metrics/src/logreceiver.rs +++ b/metrics/src/logreceiver.rs @@ -18,7 +18,9 @@ async fn receive_log( while let Some(msg) = stream.next().await { match msg { Ok(Message::Text(text)) => { - let _ = logprocessor::log_processor(&text.trim().to_string(), &metric_obj, &tracer).await; + for line in text.split("\n") { + let _ = logprocessor::log_processor(&line.trim().to_string(), &metric_obj, &tracer).await; + } session.text("{\"success\": true}").await.unwrap(); }