logswan

Fast Web log analyzer using probabilistic data structures
Log | Files | Refs | README | LICENSE

commit 73412abefc1b91027ec92bcbcce57c5c415652df
parent d39da325439ab1e520ae873e4d432c1e2b95a401
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Mon, 22 Jun 2015 18:33:27 +0200

Parsing date during log processing phase

Diffstat:
Msrc/logswan.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/logswan.c b/src/logswan.c @@ -4,7 +4,7 @@ /* https://github.com/fcambus/logswan */ /* */ /* Created: 2015/05/31 */ -/* Last Updated: 2015/06/21 */ +/* Last Updated: 2015/06/22 */ /* */ /* Logswan is released under the BSD 3-Clause license. */ /* See LICENSE file for details. */ @@ -44,6 +44,7 @@ uint64_t hitsIPv4 = 0; uint64_t hitsIPv6 = 0; uint64_t countries[255]; +struct date parsedDate; struct logLine parsedLine; struct sockaddr_in ipv4; @@ -111,6 +112,9 @@ int main (int argc, char *argv[]) { countries[GeoIP_id_by_addr(geoip, parsedLine.remoteHost)]++; } + /* Parse date */ + parseDate(&parsedDate, parsedLine.date); + /* Count HTTP status codes occurences */ if (parsedLine.statusCode) { /* Do not feed NULL tokens to strtol */ statusCode = strtol(parsedLine.statusCode, &endptr, 10);