summaryrefslogtreecommitdiff
path: root/src/ingestor.hpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-08-21 20:39:52 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2025-08-25 16:00:59 +0100
commitb2416925f8845b70ed25fb4ec7cde8ef11e8c239 (patch)
tree9ed898937ddceca6bcf0e2a6d6dfda3754dceefe /src/ingestor.hpp
downloadwebstat-b2416925f8845b70ed25fb4ec7cde8ef11e8c239.tar.bz2
webstat-b2416925f8845b70ed25fb4ec7cde8ef11e8c239.tar.xz
webstat-b2416925f8845b70ed25fb4ec7cde8ef11e8c239.zip
Initial commit; basic Apache log parsing
Diffstat (limited to 'src/ingestor.hpp')
-rw-r--r--src/ingestor.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ingestor.hpp b/src/ingestor.hpp
new file mode 100644
index 0000000..97ce9f9
--- /dev/null
+++ b/src/ingestor.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "logTypes.hpp"
+#include <cstdio>
+#include <scn/scan.h>
+
+namespace WebStat {
+ class Ingestor {
+ public:
+ using ScanResult = decltype(scn::scan<std::string_view, std::string_view, uint64_t, std::string_view,
+ QuotedString, QueryString, std::string_view, unsigned short, unsigned int, unsigned int, CLFString,
+ CLFString>(std::declval<std::string_view>(), ""));
+
+ [[nodiscard]] static ScanResult scanLogLine(std::string_view);
+
+ void ingestLog(std::FILE *);
+
+ protected:
+ size_t linesRead = 0;
+ size_t linesParsed = 0;
+ size_t linesDiscarded = 0;
+ };
+}