Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

contrail-logs (Accessing Log File Messages)

A command-line utility, contrail-logs, uses REST APIs to retrieve system log messages, object log messages, and trace messages.

Command-Line Options for Contrail-Logs

The command-line utility for accessing log file information is contrail-logs in the analytics node. The following are the options supported at the command line for contrail-logs, as viewed using the -–help option.

Option Descriptions

The following are the descriptions for each of the option arguments available for contrail-logs.

Example Uses

The following examples show how you can use the option arguments available for contrail-logs to retrieve the information you specify.

  1. View only the system log messages from all boxes for the last 10 minutes.

    contrail-logs

  2. View all log messages (systemlog, objectlog, uve, ...) from all boxes for the last 10 minutes.

    contrail-logs --all

  3. View only the control node system log messagess from all boxes for the last 10 minutes.

    contrail-logs --module ControlNode

    --module accepts the following values - ControlNode, VRouterAgent, ApiServer, Schema, ServiceMonitor, Collector, OpServer, QueryEngine, DnsAgent

  4. View the control node system log messages from source a6s23.contrail.juniper.net for the last 10 minutes.

    contrail-logs --module ControlNode --source a6s23.contrail.juniper.net

  5. View the XMPP category system log messages from all modules on all boxes for the last 10 minutes.

    contrail-logs --category XMPP

  6. View the system log messages from all the boxes from the last hour.

    contrail-logs --last 1h

  7. View the system log messages from the VN object named demo:admin:vn1 from all boxes for the last 10 minutes.

    contrail-logs --object ObjectVNTable --object-id demo:admin:vn1

    --object accepts the following values - ObjectVNTable, ObjectVMTable, ObjectSITable, ObjectVRouter, ObjectBgpPeer, ObjectRoutingInstance, ObjectBgpRouter, ObjectXmppConnection, ObjectCollectorInfo

  8. View the system log messages from all boxes for the last 10 minutes in reverse chronological order:

    contrail-logs --reverse

  9. View the system log messages from a specific time interval and display them in a specified date format.

    contrail-logs --start-time "2020 May 12 18:30:27.0" --end-time "2020 May 12 18:31:27.0"