A better way to look at / tail the pihole log (windows)

I got this idea when reading the logstalgia topic.

so first install openssh for windows, you can get it here.
download baretail for windows, you can get it here (free version)

now create this command file (baretail-pihole-log.cmd):
rem change the location of baretail to match your location
start C:\install\baretail.exe c:\temp\pihole.log
rem this directory contains an exact copy of the /home/pi/.ssh directory
rem the path below should match the location of this local copy
CD \install\Raspberry\v2.12.1\home\pi\.ssh
ssh -i id_rsa pi@your_pi_IP_address "sudo tail -f /var/log/pihole.log" >c:\temp\pihole.log

I'm using this with ssh keys, so you need to create the ssh keys (explained here, chapter 4.9) . If you don't want to use key authentication just replace the last line with:
ssh pi@your_pi_IP_address "sudo tail -f /var/log/pihole.log" >c:\temp\pihole.log

The fun part of using baretail is Preferences / Highlighting:
Just add some keyword(s) and select a color, the entries will be marked accordingly

If your using openssh for windows for the first time, and you are using key authentication,you may get a warning about permissions, change the (windows) permissions of the folder holding your local keys, so only you have access. (first add yourself with full control, then remove inheritable permissions, don't f**k this up, you'll loose access to the folder)

If you recently reinstalled your linux system, the fingerpint of the key will have changed, you'll get a warning and the session will not start. Search for the file known_hosts on your windows system and delete it (probably in C:\Users\your-user-account\.ssh)

1 Like