From 28e379c4adb1644e1dfd50f67b232c0894e79dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Dom=C3=ADnguez=20Vega?= Date: Thu, 27 Jun 2019 14:25:57 -0400 Subject: [PATCH] Adding auth and active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luis Felipe Domínguez Vega --- src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1b63932..759ace7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -82,7 +82,9 @@ fn main() { "username", "common_name", "real_ip", - "vpn_ip" + "vpn_ip", + "active", + "auth" ]; // Create metric @@ -102,7 +104,7 @@ fn main() { access_counter.inc(); let mut statement = connection - .prepare("SELECT session_id, node, username, common_name, real_ip, vpn_ip, duration, bytes_in, bytes_out FROM log WHERE active = 1") + .prepare("SELECT session_id, node, username, common_name, real_ip, vpn_ip, duration, bytes_in, bytes_out, active, auth FROM log WHERE active = 1") .unwrap(); while let State::Row = statement.next().unwrap() { @@ -112,7 +114,9 @@ fn main() { &statement.read::(2).unwrap()[..], &statement.read::(3).unwrap()[..], &statement.read::(4).unwrap()[..], - &statement.read::(5).unwrap()[..] + &statement.read::(5).unwrap()[..], + &statement.read::(6).unwrap()[..], + &statement.read::(7).unwrap()[..] ]; duration.with_label_values(&label_values).set(statement.read::(5).unwrap()); @@ -124,4 +128,4 @@ fn main() { // receive a response. finished_sender.send(FinishedUpdate).unwrap(); } -} \ No newline at end of file +}