[Dnsmasq-discuss] Log to database

Eric Hiller mrraptor98 at gmail.com
Mon Jun 13 17:04:43 BST 2016


Albert,

That is a great idea! I used to do just this, worked wonders. Joachim,
see the tutorial:
"This paper describes an approach with rsyslogd, an alternative enhanced
syslog daemon natively supporting MySQL and PostgreSQL. "

http://www.rsyslog.com/doc/v8-stable/tutorials/database.html
Hi Joachim,

Le Sun, 12 Jun 2016 17:39:12 +0200
Joachim Zobel <jz-2014 at heute-morgen.de> a écrit:

> Hi.
>
> The main problem for my reverse_replace script is speed. It takes a
> minute, which is too slow to be run from a web gui. This is because
> the script parses the last 15k lines and puts them into an IP->name
> lookup tables made up from enviroment variables.
>
> Is there a way to log queries to a database? Something along the
> lines of log-facility=/named/pipe and a clever script that turns its
> stdin into INSERT statements. This way I could avoid building the
> lookup table.

I don"t see any option in dnsmasq for that, but maybe you could
configure your syslog/rsyslog/systemd logger to route dnsmasq logs to
some script (in addition to the standard logging), and that script
would do the database logging.

Problem, of course, is that you'd have to handle database purging, as I
don't think dnsmasq anything when it purges its cache, so your DB would
keep growing if you did not purge it, e.g. based on record date.

> Sincerely,
> Joachim

Amicalement,
--
Albert.

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss at lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20160613/6200d309/attachment.html>


More information about the Dnsmasq-discuss mailing list