Cisco Nexus 7000 Series NX-OS System Management Command Reference, Release 4.0
L Commands

Table Of Contents

L Commands

logging console

logging event

logging ip access-list cache

logging level

logging logfile

logging module

logging monitor

logging server

logging source-interface

logging timestamp

match (NetFlow)


L Commands


This chapter describes the Cisco NX-OS system management commands that begin with the letter L.

logging console

Use the logging console command to enable logging messages to the console session.

To disable logging messages to the console session, use the no form of this command.

logging console [severity-level]

no logging console

Syntax Description

severity-level

(Optional) The number of the desired severity level at which messages should be logged. Messages at or numerically lower than the specified level are logged. Severity levels are as follows:

0—emergency: System unusable

1—alert: Immediate action needed

2—critical: Critical condition—default level

3—error: Error condition

4—warning: Warning condition

5—notification: Normal but significant condition

6—informational: Informational message only

7—debugging: Appears during debugging only


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to enable logging messages with a severity level of 4 (warning) or higher to the console session:

switch# configure terminal 
switch(config)# logging console 4 
switch(config)#

Related Commands

Command
Description

show logging console

Displays the console logging configuration.


logging event

Use the logging event command to log interface events.

logging event {link-status | trunk-status} {enable | default}

no logging event {link-status | trunk-status} {enable | default}

Syntax Description

link-status

Log all UP/DOWN and CHANGE messages.

trunk-status

Log all TRUNK status messages.

default

The default logging configuration is used by interfaces not explicitly configured.

enable

To enable logging overriding port level configuration.


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to log interface events:

switch# configure terminal 
switch(config)# logging event link-status default 
switch(config)#

Related Commands

Command
Description

show logging

Displays the logging status.


logging ip access-list cache

Use the logging ip access-list cache command to configure the Optimized ACL Logging (OAL) parameters.

To reset to the default settings, use the no form of this command.

logging ip access-list cache {{entries num_entries} | {interval seconds} | {threshold num_packets}}

no logging ip access-list cache {{entries num_entries} | {interval seconds} | {threshold num_packets}}

Syntax Description

entries num_entries

Specifies the maximum number of log entries that are cached in the software; valid values are from 0 to 1048576 entries. The default value is 8000 entries.

interval seconds

Specifies the maximum time interval before an entry is sent to syslog; valid values are from 5 to 86400 seconds. The default value is 300 seconds.

threshold num_packets

Specifies the number of packet matches (hits) before an entry is sent to syslog; valid values are from 0 to 1000000 packets. The default value is 0 packets—rate limiting is off; the system log is not triggered by the number of packet matches.


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to to specify the maximum number of log entries that are cached in the software:

switch# configure terminal 
switch(config)# logging ip access-list cache entries 200 
switch(config)#

This example shows how to specify the maximum time interval before an entry is sent to the system log:

switch# configure terminal 
switch(config)# logging ip access-list cache interval 350 
switch(config)#

This example shows how to specify the number of packet matches before an entry is sent to the system log:

switch# configure terminal 
switch(config)# logging ip access-list cache threshold 125 
switch(config)#

Related Commands

Command
Description

show logging ip access-list

Displays the status of IP access list logging.


logging level

Use the logging level command to enable logging messages from the defined facility that have the specified severity level or higher.

To disable logging messages from the defined facility, use the no form of this command.

logging level facility severity-level

no logging level facility severity-level

Syntax Description

facility

Define the appropriate facility. The facilities are listed in the "System Message Logging Facilities" section on page 317.

To apply the same severity level to all facilities, use the all facility.

severity-level

The number of the desired severity level at which messages should be logged. Messages at or numerically lower than the specified level are logged. Severity levels are as follows:

0—emergency: System unusable

1—alert: Immediate action needed

2—critical: Critical condition—default level

3—error: Error condition

4—warning: Warning condition

5—notification: Normal but significant condition

6—informational: Informational message only

7—debugging: Appears during debugging only


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to enable logging messages from the AAA facility that have a severity level of 2 or higher:

switch# configure terminal 
switch(config)# logging level aaa 2 
switch(config)#

Related Commands

Command
Description

show logging level

Displays the facility logging level configuration.


logging logfile

Use the logging logfile command to configure the name of the log file used to store system messages and the minimum severity level to log.

To disable logging to the log file, use the no form of this command.

logging logfile logfile-name severity-level [size bytes]

no logging logfile [logfile-name severity-level [size bytes]]]

Syntax Description

logfile-name

Configure the name of the log file to be used to store system messages.

severity-level

The number of the desired severity level at which messages should be logged. Messages at or numerically lower than the specified level are logged. Severity levels are as followsl:

0—emergency: System unusable

1—alert: Immediate action needed

2—critical: Critical condition—default level

3—error: Error condition

4—warning: Warning condition

5—notification: Normal but significant condition

6—informational: Informational message only

7—debugging: Appears during debugging only

size bytes

(Optional) Specify a maximum file size. The default file size is 10485760 bytes and can be configured from 4096 to 10485760 bytes.


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to configure a log file called logfile to store system messages and set its severity level to 4:

switch# configure terminal 
switch(config)# logging logfile logfile 4 
switch(config)#

Related Commands

Command
Description

show logging logfile

Displays the log file.


logging module

Use the logging module command to enable module log messages. Set a specified severity level or use the default.

To disable module log messages, use the no form of this command.

logging module [severity-level]

no logging module

Syntax Description

severity-level

(Optional) The number of the desired severity level at which messages should be logged. Messages at or numerically lower than the specified level are logged. Severity levels are as followsl:

0—emergency: System unusable

1—alert: Immediate action needed

2—critical: Critical condition

3—error: Error condition

4—warning: Warning condition

5—notification: Normal but significant condition—default level

6—informational: Informational message only

7—debugging: Appears during debugging only


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to enable module log messages:

switch# configure terminal 
switch(config)# logging module 
switch(config)#

Related Commands

Command
Description

show logging module

Displays the module logging status.


logging monitor

Use the logging monitor command to enable the device to log messages to the monitor (terminal line). This configuration applies to telnet and SSH sessions.

To disable monitor log messages, use the no form of this command.

logging monitor [severity-level]

no logging monitor

Syntax Description

severity-level

(Optional) The number of the desired severity level at which messages should be logged. Messages at or numerically lower than the specified level are logged. Severity levels are as followsl:

0—emergency: System unusable

1—alert: Immediate action needed

2—critical: Critical condition—default level

3—error: Error condition

4—warning: Warning condition

5—notification: Normal but significant condition

6—informational: Informational message only

7—debugging: Appears during debugging only


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to enable monitor log messages:

switch# configure terminal 
switch(config)# logging monitor 
switch(config)#

Related Commands

Command
Description

show logging monitor

Displays the status of monitor logging.


logging server

Use the logging server command to configure a Remote Syslog Server at the specified host name or IPv4/IPv6 address.

To disable the Remote Syslog Server, use the no form of this command.

logging server host [severity-level [use-vrf VRF_name [facility {auth | authpriv | cron | daemon | ftp | kernel | local0 | local1 | local2 | local3 | local4 | local5 | local6 | local7 | lpr | mail | news | syslog | user | uucp}]]]

no logging server host

Syntax Description

host

Configure the host name or IPv4/IPv6 address of the Remote Syslog Server.

severity-level

(Optional) The number of the desired severity level at which messages should be logged. Messages at or numerically lower than the specified level are logged. Severity levels are as follows:

0—emergency: System unusable

1—alert: Immediate action needed

2—critical: Critical condition—default level

3—error: Error condition

4—warning: Warning condition

5—notification: Normal but significant condition

6—informational: Informational message only

7—debugging: Appears during debugging only

use-vrf VRF_name

(Optional) Enable VPN routing and forwarding (VRF) and create a VRF instance named VRF_name.

facility facility

(Optional) Define the appropriate outgoing facility. The facilities are listed in the "System Message Logging Facilities" section on page 317.

The default outgoing facility is local7.


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to configure a Remote Syslog Server at a specified IPv4 address, using the default outgoing facility:

switch# configure terminal 
switch(config)# logging server 172.28.254.253 
switch(config)#

This example shows how to configure a Remote Syslog Server at a specified host name, with severity level 5 or higher:

switch# configure terminal 
switch(config)# logging server syslogA 5 
switch(config)#

Related Commands

Command
Description

show logging server

Displays the configured syslog servers.


logging source-interface

Use the logging source-interface command to enable a source interface for the Remote Syslog Server.

To disable the source interface, use the no form of this command.

logging source-interface loopback virtual_interface

no logging source-interface loopback virtual_interface

Syntax Description

loopback virtual_interface

Enable the loopback interface selecting the virtual interface number from 0 to 1023.


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to enable a source interface for the syslog server:

switch# configure terminal 
switch(config)# logging source-interface loopback 5 
switch(config)#

logging timestamp

Use the logging timestamp command to set the logging timestamp units. By default, the units are seconds.

To reset the logging timestamp units to the default, use the no form of this command.

logging timestamp {microseconds | milliseconds | seconds}

no logging timestamp {microseconds | milliseconds | seconds}

Syntax Description

microseconds | milliseconds | seconds

Select the units to use for logging timestamps. The default units are seconds.


Defaults

None

Command Modes

Global configuration

Supported User Roles

Super user
VDC administrator
VDC user

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

This command does not require a license.

Examples

This example shows how to set the logging timestamp units to microseconds:

switch# configure terminal 
switch(config)# logging timestamp microseconds 
switch(config)#

Related Commands

Command
Description

show logging timestamp

Displays the logging timestamp configuration.


match (NetFlow)

To specify match criteria for Flexible NetFlow flow records, use the match flow record configuration mode subcommand. To remove match criteria for Flexible NetFlow flow records, use the no form of this command.

match {flow direction | interface {input | output} | ip {protocol | tos} | ipv4 {destination address | source address} | transport {destination-port | source-port}}

match {flow direction | interface {input | output} | ip {protocol | tos} | ipv4 {destination address | source address} | transport {destination-port | source-port}}

Syntax Description

flow direction

Direction of the flow to be matched.

interface input

Specifies that the match criterion is based on the input interface.

interface output

Specifies that the match criterion is based on the output interface.

ip protocol

Specifies that the match criterion is based on protocol.

ip tos

Specifies that the match criterion is based on type of service (ToS).

ipv4 destination address

Specifies that the match criterion is based on the destination IPv4 address.

ipv4 source address

Specifies that the match criterion is based on the source IPv4 address.

transport destination-port

Specifies that the match criterion for transport layer fields is based on the destination port.

transport source-port

Specifies that the match criterion for transport layer fields is based on the destination port.


Command Default

No matching criteria are specified by default.

Command Modes

Flow record configuration

Supported User Roles

network-admin
vdc-admin

Command History

Release
Modification

4.0(1)

This command was introduced.


Usage Guidelines

A Flexible NetFlow flow record must be enabled before you can use the match command.

This command does not require a license.

Examples

The following example shows how to specify the direction of the flow to be matched:

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match flow direction

Specifies that the match criterion is based on the input interface.

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match interface input

Specifies that the match criterion is based on the output interface.

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match interface output

Specifies that the match criterion is based on protocol.

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match ip protocol

Specifies that the match criterion is based on type of service (ToS).

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match ip tos

Specifies that the match criterion is based on the destination IPv4 address.

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match ipv4 destination address

Specifies that the match criterion is based on the source IPv4 address.

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match ipv4 source address

Specifies that the match criterion for transport layer fields is based on the destination port.

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match ipv4 transport destination-port

Specifies that the match criterion for transport layer fields is based on the source port.

switch(config)# flow record FLOW-RECORD-1
switch(config-flow-record)# match ipv4 transport source-port

Related Commands

Command
Description

flow record

Creates a flow record.