How do you view just the end of the VPN logs

Not sure this is the right place, but the problem exists mainly when debugging an IPSEC tunnel. The issue is that it can take many (10+) minutes of scrolling just to get to the end of the IPSEC log so you can see what’s going on currently. I’ve tried to google and search the community, but I’ve never found a way to just look at the end of the vpn logs…

hi @bbushvt and welcome to the Vyos forums!

Shift-G will zip you to the end of any logs. Assuming you are using “show log”

I tend to do show log | less so you can do shift-G and then press “b” for back to go backwards in time.

If that doesn’t help please post more details about the command(s) you’re using and we’ll see what we can do!

1 Like

You can also use Linux Pipe commands like tail when doing show commands. Just do something like (this shows the last 50 lines in the default log):

show log | tail -n 50
1 Like

So the Shift-G doesn’t seem to work (though maybe its just taking a long time), using show log vpn | tail -n 50 also takes a very long time:
$ time show log vpn | tail -n 50

real 5m56.370s
user 2m13.143s
sys 3m43.708s

It is a large file:
$ show log vpn | wc -l

Is there a way we can speed this up? Which file is that data coming from?

You can try this:

For IPsec:
journalctl --no-hostname --boot --unit strongswan.service -r

For VPN:
journalctl --no-hostname --boot --unit strongswan.service --unit accel-ppp@*.service --unit ocserv.service -r