Pi-Hole and Logstalgia on Windows

Hi,

recently i found this nice article:
http://jacobsalmela.com/visualize-ads-blocked-in-real-time-using-pi-hole-and-logstalgia/
someone said it doesnt work for windows but i managed it to get it working.
here is what i did.

so first install openssh for windows you can get it from here:
https://www.mls-software.com/opensshd.html

then install logstalgia for windows:
http://logstalgia.io/

open command promt and enter this:
ssh pi@192.168.1.114 "tail -f /var/log/lighttpd/access.log" | logstalgia --sync

well you have to type your raspberry pi's ip address mine is 192.168.1.114.

then a window should appear:

its pretty neat have fun.

1 Like

Yeah, this is still one of my fav things to do. Glad you got it working!

do you know how to get this working again with the updated versions of pi-hole?

Nothing has changed in terms of the access.log, which is formatted for Logstalgia, so this should still work as-is unless Logstalgia changed the format it expects.

Some findings for windows users:
I've configured key authentication on my raspberry pi (see here, chapter 4.9) and disabled password authentication (chapter 4.11).

  • Downloaded the files, as indicated by hupo (first entry of this post), I needed to disable my virus scanner, as these files are not trusted.
  • install the programs, openssh first, you don't need ssh server, only the client

Since password authentication won't work (disabled) you need to change the permission on your local copy of the file id_rsa (instructions recorded on windows 7), because openssh refuses to key authenticate, if the key is accessible by multiple users:
don't mess this up, you will lose access to the file!

  • step one: right click, properties, security, edit, add, add your windows username, check names, ok, assign full control to yourself, apply.
    Just to be on the safe side, close the 'properties' dialog and open it again. Verify your windows account is there and has full control!
  • step two: advanced, change permissions, uncheck 'Include inheritable permissions from this objects parent', apply, ok, ok
    There should be only one user (your windows username) in the 'group or user names' list.

Now open a command prompt, if your system is UAC enabled, right click and 'run as administrator'

CD into the folder, holding the id_rsa file (the authentication key)
enter:
ssh -i id_rsa pi@192.168.1.114 "sudo tail -f /var/log/lighttpd/access.log" | logstalgia --sync
(replace the IP address)
browse to http://192.168.1.114/admin to see the results in Logstalgia (replace the IP address)

remember, if you edit or recreate this file, the permissions will be gone. By default, it's bad practice to assign permissions on the file level (should always use folder), but since openssh is so picky about these permissions ...

hope this helps someone...

Sorry for the necro,
Is this outdated? Logstalgia is only showing pi.hole traffic not any blocked ads. Which got me thinking, why would /var/log/lighttpd/access.log contain blocked request information?
Looking at access.log and it's only populated with local requests

Pihole use to have only one blockingmode. In previous versions (v1.x and v2.x), pihole responded to a blocked site with a web page, indicating the requested website was blocked. All of these blocked replies used to be logged in /var/log/lighttpd/access.log, as they are served by lighttpd, pihole's webserver.
The default blocking mode is now null blocking, witch doesn't inform the user of blocking anymore. This change was made because most of the add servers started using https, pihole can only serve the blocking information if http is used.

In short, if you're using the default blocking mode, it's normal that you only see the local requests, i.e. the requests made by the pihole admin interface.

You can still use openssh to look at other logs on your system, explained here.