I've created a elasticstack configuration for pi-hole so one can easily collect, filter, search and visualize pi-holes log data.
This is meant to be a alternative to the built in dashboards.
So if anyone is interested there is a github repo:
This repo requires you to previously setup the elk stack but then provides you with the required files/configuration to implement some nice viszualtion.
Feel free to try it out and/or ask if something isn't working as expected
Thanks to @skaldenhoven for providing some nice input as well as testing and troubleshooting the parsing logic!
@DL6ER or @Mcat12 could you please move/tag this thread to the correct destination as I'm not sure where it belongs to.
Would this be possible to run on a single Raspberry Pi 3 B?
You might know about the required resources. As of right now I am using 30% RAM and barely any CPU as this RPI is only hosting Pi-Hole and a MySQL DB.
It would be really sweet to see where all the queries are going to.
Yes that would be possible, but you can't run elastic, logstash or kibana on the pi. But of course you/we can implement a heat map on the elk side to visualize the destination of the query
I am very interested in implementing this solution (thank you for contributing it). My first hurdle to overcome is getting Beats to work on my Raspberry Pi 3. Most of the steps I have followed to install Go and build it fail. I am wondering if it would be easier to install logstash on the Pi instead.
Logstash on the pi isnt a possible solution as logstash requires LOTS of ram (at least a few GB) not to mention the cpu requirements. You definelty need a separate Maschine. I'm running the complete elk Stack on an Intel nuc with esxi and 11 vms. This is sufficient
It feels like it would be easier to write my own utility to tail logs and ship them to logstash than mess with building Go
Building Go cmd/dist using /home/pi/.gvm/gos/go1.8.
Building Go toolchain1 using /home/pi/.gvm/gos/go1.8.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
# cmd/compile/internal/ssa
fatal error: runtime: out of memory
before creating the project I had it running in almost the same way but without filebeat. I did send all off /var/log/pihole.log via rsyslog to the remote logstash instance - that will work too.
Slowly working through the process of getting this working. Now I have data flowing into ELK but I noticed that the timestamp is the time the data was received not the datetime in the log. First entry in the log shows May 7 00:00:05 and that is what I expected the @timestamp to be. Is this how it works for you?
@aviationfan sorry I initially missunderstood the core of your question. You are right, as of now the order is dependant of @timestamp. We have to customize the filebeat index mapping to change this - I will have a look "how" and will get back to you
Yes this is expected as @timestamp is a meta field generated by logstash to display the processing time
There is a field called "date" representing the actual dnsmasq timestamp
I was looking at your setup and wondering how to do the same thing. In hindsight I would have used a better name than "created" do describe the date and time stamp from the log.
is that kibana 4.x? never tried it before with such an old version sorry. There is a a "Dev Tools" menu on the left side in more recent versions of kibana. Could you try again with elk stack running version 7.x?
Yes, I didn't realize it was such an old version. Followed some tutorial on setting up ELK stack. Upgrading seems to have broken it so I will blow it away and build a new stack. Do you have good tutorial handy for standing up ELK on CentOS 7?
for installation of the stack only you should be good to go with this:
never tried this exact tut but it seems to be "ok". just dont set Xms and Xmx to different values. They have to be the same to make sure performance isnt compromised
################################################################
Xms represents the initial size of total heap space
Xmx represents the maximum size of total heap space