What is the filter rule syntax? What xFlow (NetFlow/sFlow/jFlow) and IPFIX filter parameters are supported by PRTG?
What filter rules can be used for custom Packet Sniffing, xFlow, or IPFIX sensors?
This article applies to PRTG Network Monitor 16 or later
Filter Rules for Custom Packet Sniffing, xFlow, or IPFIX Sensors
Note: For details (i.e., additional rules), please see PRTG Manual: Filter Rules for xFlow, IPFIX and Packet Sniffer Sensors.
Filter rules are used for the include, exclude and channel definition fields of custom packet sniffer, NetFlow, sFlow, jFlow, and IPFIX sensors.
Filter rules are based on the following format:
Valid fields are:
- Protocol (values: TCP, UDP, ICMP, OSPFIGP or any number)
Additional Packet Sniffer Fields:
- EtherType (values IPV4, ARP,RARP,APPLE, AARP,IPV6 ,IPXold, IPX or any number)
Additional NetFlow v5 / jFlow fields:
Additional NetFlow v9 and IPFIX fields:
- Note: 'Masks' represent subnet masks in the form of a single number ('number of contiguous bits')
- NextHop (IP address)
- Note: 'VLANs' represent a VLAN identifier
Additional sFlow fields:
- IP fields support wildcards (*), range (10-20) and hostmask ( /10, /255.255.0.0) syntax (all IPv4 only), as well as DNS names.
- Number fields support range (80-88) syntax.
- Protocol and EtherType fields support numbers and a list of predefined constants.
SourceIP[10.0.0.1] SourceIP[10.*.*.*] SourceIP[10.0.0.0/10] DestinationIP[10.0.0.120-130] DestinationPort[80-88] Protocol[UDP]
Complex expressions can be created using parentheses and and/or/not:
Protocol[TCP] and not (DestinationIP[10.0.0.1] or SourceIP[10.0.0.120-130])
This may be a dumb question but I want to make sure. Would
|IP[192.168.0.0/20] OR IP[192.168.50.0/20]|
catch packets to/from machines on the 192.168.0.0/20 and 192.168.50.0/20 ranges the same way
|SourceIP[192.168.0.0/20] OR DestinationIP[192.168.0.0/20] OR SourceIP[192.168.50.0/20] OR DestinationIP[192.168.50.0/20]|
I'm thinking yes, but that is not actually covered in the manual as far as I can tell and I'm trying to simplify some of my packet filtering rules.
yes. SourceIP[x] or DestinationIP[x] is the same as IP[x].