
To combine expressions, use the logical operators listed in Table 508 on page 3837.
Table 508: Logical Operators for the monitor traffic Command
Description
Logical Operator (Highest to
Lowest Precedence)
Logical NOT. If the first condition does not match, the next condition is evaluated.
!
Logical AND. If the first condition matches, the next condition is evaluated. If the first condition
does not match, the next condition is skipped.
&&
Logical OR. If the first condition matches, the next condition is skipped. If the first condition
does not match, the next condition is evaluated.
||
Group operators to override default precedence order. Parentheses are special characters,
each of which must be preceded by a backslash (
\
).
( )
You can use relational operators to compare arithmetic expressions composed of integer
constants, binary operators, a length operator, and special packet data accessors. The
arithmetic expression matching condition uses the following syntax:
monitor traffic matching "ether[0] & 1 != 0""arithmetic_expression relational_operator
arithmetic_expression"
The packet data accessor uses the following syntax:
protocol [byte-offset <size>]
The optional
size
field represents the number of bytes examined in the packet header.
The available values are
1, 2,
or
4
bytes.The following sample command captures all
multicast traffic:
user@host> monitor traffic matching "ether[0] & 1 != 0"
To specify match conditions that have a numeric value, use the arithmetic and relational
operators listed in Table 509 on page 3838.
3837
Copyright © 2010, Juniper Networks, Inc.
Chapter 135: Operational Mode Commands for General Network Management and Monitoring
Summary of Contents for JUNOS OS 10.3 - SOFTWARE
Page 325: ...CHAPTER 17 Operational Mode Commands for System Setup 229 Copyright 2010 Juniper Networks Inc ...
Page 1323: ...CHAPTER 56 Operational Mode Commands for Interfaces 1227 Copyright 2010 Juniper Networks Inc ...
Page 2841: ...CHAPTER 86 Operational Commands for 802 1X 2745 Copyright 2010 Juniper Networks Inc ...
Page 3367: ...CHAPTER 113 Operational Mode Commands for CoS 3271 Copyright 2010 Juniper Networks Inc ...
Page 3435: ...CHAPTER 120 Operational Mode Commands for PoE 3339 Copyright 2010 Juniper Networks Inc ...
Page 3529: ...CHAPTER 126 Operational Mode Commands for MPLS 3433 Copyright 2010 Juniper Networks Inc ...