Usefull CLI commands to work with logs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Usefull CLI commands to work with logs

L4 Transporter

Hello

 

I spend a lot of time playing with logs, ie.

 less mp-log ikemgr.log

How to:

- go to end of this file?

- search forward/backward keyword

- scrool up/down

 

and you problably know many other userfull keywords. Please share with us who are not well trained 😉 - yet

 

 

Regards

SLawek

2 accepted solutions

Accepted Solutions

Cyber Elite
Cyber Elite

Hi SLawek

 

less on the firewall works a lot like less in linux

 

if you open a log file

  • shift+g will take you to the end of the file (regular 'g' will take you to start of file)
  • /<keyword> to search , while in search use 'n' to go to the next or 'N' (shift+n) to go to the previous
  • only use arrow keys to scroll up or down

 

 

Tom Piens
PANgurus - Strata specialist; config reviews, policy optimization

View solution in original post

Here is the command reference for 'tail':

tail
{
follow {no | yes} |
lines <value> |
agent-log <value> |
dp-log <file> |
mp-log <file> |
webserver-log <file>
}
 
You can find all the the CLI commands in the documentation section of the CLI Reference guides. Here is the link for the 6.1 version, https://www.paloaltonetworks.com/content/dam/paloaltonetworks-com/en_US/assets/pdf/technical-documen...

View solution in original post

6 REPLIES 6

Cyber Elite
Cyber Elite

Hi SLawek

 

less on the firewall works a lot like less in linux

 

if you open a log file

  • shift+g will take you to the end of the file (regular 'g' will take you to start of file)
  • /<keyword> to search , while in search use 'n' to go to the next or 'N' (shift+n) to go to the previous
  • only use arrow keys to scroll up or down

 

 

Tom Piens
PANgurus - Strata specialist; config reviews, policy optimization

you should have fun with command 'tail' too

'follow' is another good one if you want to see it realtime...

Could You give full comnand example for "follow"

 

from my finding another usefull command is:

 

tail lines 200 mp-log ikemgr.log - shows last 200 lines.

 

 

Regards

SLawek

Here is the command reference for 'tail':

tail
{
follow {no | yes} |
lines <value> |
agent-log <value> |
dp-log <file> |
mp-log <file> |
webserver-log <file>
}
 
You can find all the the CLI commands in the documentation section of the CLI Reference guides. Here is the link for the 6.1 version, https://www.paloaltonetworks.com/content/dam/paloaltonetworks-com/en_US/assets/pdf/technical-documen...

And like Linux you can use 'h' to show a help screen with more commands on.

  • 2 accepted solutions
  • 57496 Views
  • 6 replies
  • 1 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!