gm3dmo/syslog-to-csv

Calculate and print a timespan for the logs analyzed

gm3dmo opened this issue · 1 comments

Add this to the generator:

.print ''
.print '============================================================='
.print ''
.width 0 0 0
select  min(now) as "first_record", max(now) as "last_record",  printf("%.2f", JULIANDAY(max(now)) - JULIANDAY(min(now))) AS "span (days)" from unicorn where now != '';

Done

message                                                       count_of  percentage
------------------------------------------------------------  --------  ----------
Authentication success via token                              54        79.41
                                                              9         13.24
Authentication success                                        3         4.41
Authentication failure                                        1         1.47
Invalid LDAP login credentials.                               1         1.47

protocol                                                      count_of  percentage
------------------------------------------------------------  --------  ----------
                                                              57        83.82
http                                                          11        16.18


=============================================================

first_record          last_record           span (days)
--------------------  --------------------  -----------
2023-02-18T13:27:41Z  2023-02-18T13:46:43Z  0.01