Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

How to collect /var/log files from all members of an EX Switch Virtual Chassis (VC) using the tar command



Article ID: KB15186 KB Last Updated: 29 Mar 2021Version: 8.0

This article describes how to collect log files from the /var/log folder of all the member switches in a Virtual Chassis (VC) environment using the tar method. The log files in the /var/log directory are required by Juniper Technical Support (JTAC) to analyze issues that are reported to Juniper Support.


The /var/log files can be collected using the tar method or the file archive compress method. This article provides the instructions using the tar method.

For an alternate, simpler method using file archive compress, refer to:


Follow the steps below to collect all the files from the /var/log directory of each member of a virtual chassis.

NOTE: You will need FTP, SSH, HTTP (JWEB) or USB access to the EX Switch to copy the logs from the Switch.

  1. Login to the EX Virtual Chassis (VC) using the management IP address or console. You will be logged into the primary switch of the EX Virtual Chassis. In this example, member 0 is the primary switch.

  2. Login to the shell prompt as the root user.

    user@router> start shell user root
  3. Use the "tar" command to compress the folder /var/log and its contents.  The file will be saved to /var/tmp directory

    root% tar -zcvf /var/tmp/varlog-mem0.tar.gz /var/log/*
  4. Verify whether the tar.gz file has been created

    root% ls /var/tmp
    .ssh varlog-mem0.tar.gz
  5. Exit from the shell prompt using the command "exit" and you will be placed on the CLI prompt of Primary switch

    root% exit
  6. Request a session to the next member of the virtual chassis using its member ID.  To verify which member you are connected to, use the "show virtual chassis" command and it will display an asterisk * next to the member you are connected to.

    root> request session member 1
  7. Login to the shell as the root user

    root> start shell user root
  8. Use the "tar" command to compress the folder /var/log and its contents.

    root% tar -zcvf /var/tmp/varlog-mem1.tar.gz /var/log/*
  9. Verify whether the tar.gz file has been created

    root% ls /var/tmp
    .ssh varlog-mem1.tar.gz
  10. Go to the CLI of current member to copy the member log files to primary.

    root% cli
  11. Execute the file copy command to copy the tar.gz file from the current member switch to the /var/tmp directory on primary switch

    root> file copy fpc1:/var/tmp/varlog-mem1.tar.gz fpc0:/var/tmp/
  12. Exit from the current member session. Now you will be logged back into the Primary switch.

    root> exit
  13. Repeat steps 6 through 12 by changing the member id until all the member logs are loaded to the primary switch.

    Be sure to name each file according the member id to easily identify.

Now the files can be directly copied from the EX Virtual Chassis primary to any local host using ftp, scp, JWEB, or mounted USB.

NOTE: FTP, SSH and HTTP are configured under the 'system services' stanza.  See Related Links below.

Modification History:
2021-03-24: ‚Äč: Updated the article terminology to align with Juniper's Inclusion & Diversity initiatives.
2020-02-13: Article reviewed for accuracy; no changes required.

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search