Hi,. I would like to be able to integrate requests that I can retrieve from /var/log/pihole.log and then associate ALL of the individual log entries from a 'session', i.e. a specific request, so that I can use that information in a security logging environment.
as an example in my current pihole.log is;
Jul 14 19:07:12 dnsmasq[814]: query[A] login.live.com from 192.168.1.66
Jul 14 19:07:12 dnsmasq[814]: forwarded login.live.com to 1.1.1.1
Jul 14 19:07:12 dnsmasq[814]: reply login.live.com is <CNAME>
Jul 14 19:07:12 dnsmasq[814]: reply login.msa.msidentity.com is <CNAME>
Jul 14 19:07:12 dnsmasq[814]: reply login.msa.akadns6.net is <CNAME>
Jul 14 19:07:12 dnsmasq[814]: reply vs.login.msa.akadns6.net is 40.90.23.229
Jul 14 19:07:12 dnsmasq[814]: reply vs.login.msa.akadns6.net is 40.90.23.153
Jul 14 19:07:12 dnsmasq[814]: reply vs.login.msa.akadns6.net is 40.90.23.218
I'd find it beneficial for this to be enhanced a little such as;
Jul 14 19:07:12 dnsmasq[814] 1000-1: query[A] login.live.com from 192.168.1.66
Jul 14 19:07:12 dnsmasq[814] 1000-2: forwarded login.live.com to 1.1.1.1
Jul 14 19:07:12 dnsmasq[814] 1000-3: reply login.live.com is <CNAME>
Jul 14 19:07:12 dnsmasq[814] 1000-4: reply login.msa.msidentity.com is <CNAME>
Jul 14 19:07:12 dnsmasq[814] 1000-5: reply login.msa.akadns6.net is <CNAME>
Jul 14 19:07:12 dnsmasq[814] 1000-6: reply vs.login.msa.akadns6.net is 40.90.23.229
Jul 14 19:07:12 dnsmasq[814] 1000-7: reply vs.login.msa.akadns6.net is 40.90.23.153
Jul 14 19:07:12 dnsmasq[814] 1000-8: reply vs.login.msa.akadns6.net is 40.90.23.218
Now, the example '1000-n', is only trying to show that a specific query 'session' is in this case (some sequence) #1000 and it just happens to have 8 individual detail log records associated with the 'session' (query). Further, the previous 'session' would have been #999 and the subsequent session (query) would be #1001, each might have its own unique number of individual detail quantity (1-n).
Note: as some of the monitoring (FTL) is clearly showing that 'sessions' (queries) are being counted and thus are know to be unique, of course they are because each 'session' (query) results in a response to the submitter that 'counter' could very well be the session counter (the #- part) and the 'session' (query) 1-n count would be associated with that. I would not really be overly concerned about the session # restarting with a restart of pihole but persisting it would also be acceptable, until possibly some day as in your higher-end examples of millions of queries per day results in a substantially large session number (session id) and someone worries about signed/unsigned 32-bit counters (they do still exist...). Anyway, some sort of session counter that yields uniqueness....
My usage would then be to pull the entries from the /var/log/pihole.log and generate a series of log events that I would send to a SIEM, e.g. ArcSight, and long term storage for such needs as audit and analytics. I'd still have to do some parsing around merging/concantenating the query line with the various processing/response lines but that would be doable.
I have noted others asking for external logging (syslog) feature so if that existed then I could use that and do the log entry merging on the remote host but of course depednign on the protocol used to transport, e.g. udp/tcp, loss could occur of records so i am fine doing my work on the pi-hole host.
Thank you,
Doug