Display ProxySG access logs in real-time using command line from a workstation
search cancel

Display ProxySG access logs in real-time using command line from a workstation

book

Article ID: 165671

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

This article answers the following questions:

  • How do I display ProxySG access logs in real-time from the command line (Windows or Linux)?
  • How do I tail ProxySG Access Logs from the command line?
  • How do I grep or filter ProxySG Access Logs from the command line?
  • How do I view live ProxySG access logs?
  • How do I view ProxySG access logs in real-time without sending the data to Reporter?

Resolution

Software

Access logs can be displayed from the command line by using the open-source WGET utility. This software is available for Windows and Linux platforms. Windows users can take advantage of the Ubuntu application for Windows which has WGET installed by default.

(Note: WGET and Ubuntu are not Broadcom software, nor are they supported by Broadcom. This information is provided "as-is").

 

Command Usage

To display the main Access Log, run the following command (replacing the administrator account and proxy IP address as required). This displays access logs in real-time, showing any updates as they come in.

 

wget --http-user=admin --ask-password --no-check-certificate https://10.0.80.80:8082/Accesslog/tail-f/main -q -O -

 

Flag Description
--http-user= Specifies the management user account of the ProxySG (default admin)
--ask-password WGET will prompt for the password of the user account.
--no-check-certificate WGET will ignore TLS certificate warnings if it does not trust the appliance's HTTPS Console certificate.
-q Do not print standard WGET output.
-O - Print response data to standard out.

 

Filtering Output

It is possible to use a range of command line tools (Linux: grep, sed, awk; Windows: find) to filter the output and display only selected text. For example, to show only log entries for Google use the following command:


Linux

wget --http-user=admin --ask-password --no-check-certificate https://10.0.80.80:8082/Accesslog/tail-f/main -q -O - | grep google


Windows

wget --http-user=admin --ask-password --no-check-certificate https://10.0.80.80:8082/Accesslog/tail-f/main -q -O - | find "google"