vFlow configuration

March 14, 2021 ยท View on GitHub

Format

A config file is a plain text file in YAML format also you can be able to configure through the command line. in case you configure a key at config file and command line, the command line would be preferred.

config file

key: value

command line

-key value

Configuration Keys

The vFlow configuration contains the following keys

KeyDefaultDescription
log-filestdErrorname of log file to send logging output to
verbosefalseenable the full logging
pid-file/var/run/vflow.pidfile in which server should write its process ID
cpu-capthe number of available CPUssets the maximum number of CPUs
ipfix-enabledtrueenable/disable IPFIX decoders
ipfix-port4739server IPFIX UDP port
ipfix-addr-server IPFIX UDP IP address to bind to
ipfix-workers200IPFIX concurrent decoders
ipfix-topicvflow.ipfixipfix message queue topic name
ipfix-udp-size1500maximum IPFIX UDP packet size
ipfix-mirror-addr-IPFIX 3rd party collector address
ipfix-mirror-port4172IPFIX 3rd party collector port
ipfix-mirror-workers5IPFIX replicator concurrent packet generator
ipfix-tpl-cache-file/tmp/vflow.templatesIPFIX templates cache file
ipfix-rpc-enabledtrueenable/disable IPFIX RPC
sflow-enabledtrueenable/disable sFlow decoders
sflow-port6343server sFlow UDP port
sflow-workers200sFlow concurrent decoders
sflow-udp-size1500maximum sFlow UDP packet size
sflow-topicvflow.sflowsFlow message queue topic name
sflow-type-filter-filter sflow type(s)
netflow5-enabledtrueenable/disable netflow v5 decoders
netflow5-port9996server netflow v5 UDP port
netflow5-workers50netflow v5 concurrent decoders
netflow5-topicvflow.netflow5netflow v5 message queue topic name
netflow5-udp-size1500maximum netflow v9 UDP packet size
netflow9-enabledtrueenable/disable netflow v9 decoders
netflow9-port4729server netflow v9 UDP port
netflow9-workers50netflow v9 concurrent decoders
netflow9-topicvflow.netflow9netflow v9 message queue topic name
netflow9-udp-size1500maximum netflow v9 UDP packet size
netflow9-tpl-cache-file/tmp/netflow9.templatesnetflow v9 templates cache file
dynamic-workerstrueenable/disable dynamic workers feature
stats-enabledtrueenable/disable web stats listener
stats-formatprometheusset prometheus or restful format
stats-http-addr*web stats address option at server startup
stats-http-port8081web stats TCP port
mq-namekafkamessage queues
mq-config-file/etc/vflow/mq.confmessage queue config file
producer-enabledtrueenable/disable producer message queue

The default configuration path is /etc/vflow/vflow.conf but you can change it as below:

vflow -config /usr/local/etc/vflow.conf

The vFlow version shows as below:

vflow -version

Example

ipfix-workers: 600
sflow-workers: 300
log-file: /var/log/vflow.log

Message Queues

The vFlow supports these message queuing

  • kafka
  • kafka.segmentio
  • nsq
  • nats
  • rawSocket

Note: there are two kafka drivers: Kafka Sarama (Default) and Kafka Segmentio (Kafka-Go)

Kafka Configuration

Format

A config file is a plain text file in YAML format.

key: value

The default configuration file is /etc/vflow/mq.conf, you can be able to change it through vFlow configuration.

Configuration Keys (Default / Sarama)

The Kafka configuration contains the following key

KeyDefaultEnvironment variableDescription
brokers-VFLOW_KAFKA_BROKERSkafka broker addresses
compressionnoneVFLOW_KAFKA_COMPRESSIONcompression codecs: gzip, snappy, lz4
retry-max2VFLOW_KAFKA_RETRY_MAXthe total number of times to retry
request-size-max104857600VFLOW_KAFKA_REQUEST_SIZE_MAXthe maximum size (in bytes) of any request that will be attempted to send to Kafka
retry-backoff10VFLOW_KAFKA_RETRY_BACKOFFwait for leader election to occur before retrying in milliseconds
tls-enabledfalseVFLOW_KAFKA_TLS_ENABLEDconnect using TLS
tls-certnoneVFLOW_KAFKA_TLS_CERTcertificate file for client authentication
tls-keynoneVFLOW_KAFKA_TLS_KEYkey file for client authentication
ca-filenoneVFLOW_KAFKA_CA_FILEcertificate authority file for TLS client authentication
tls-skip-verifytrueVFLOW_KAFKA_TLS_SKIP_VERIFYif true, the server's certificate will not validate
sasl-usernamenoneVFLOW_KAFKA_SASL_USERNAMEusername for SASL authentication
sasl-usernamenoneVFLOW_KAFKA_SASL_PASSWORDpassword for SASL authentication

Example

brokers:
    - 192.16.1.25:9092
retry-max: 1
retry-backoff: 30

Configuration Keys (Segmentio)

The Kafka configuration contains the following key

KeyDefaultEnvironment variableDescription
brokersVFLOW_KAFKA_BROKERS
bootstrap-serverVFLOW_KAFKA_BOOTSTRAP_SERVER
client-idVFLOW_KAFKA_CLIENT_ID
compressionVFLOW_KAFKA_COMPRESSION
max-attemptsVFLOW_KAFKA_MAX_ATTEMPTS
queue-sizeVFLOW_KAFKA_QUEUE_SIZE
batch-sizeVFLOW_KAFKA_BATCH_SIZE
keepaliveVFLOW_KAFKA_KEEPALIVE
connect-timeoutVFLOW_KAFKA_CONNECT_TIMEOUT
required-acksVFLOW_KAFKA_REQUIRED_ACKS
pflushVFLOW_KAFKA_PERIODIC_FLUSH
tls-certVFLOW_KAFKA_TLS_CERT
tls-keyVFLOW_KAFKA_TLS_KEY
ca-fileVFLOW_KAFKA_CA_FILE
verify-sslVFLOW_KAFKA_VERIFY_SSL

NSQ Configuration

Format

A config file is a plain text file in YAML format.

key: value

The default configuration file is /etc/vflow/mq.conf, you can be able to change it through vFlow configuration.

Configuration Keys

The NSQ configuration contains the following key

KeyDefaultEnvironment variableDescription
serverlocalhost:4150NANSQ server addresse and port

NATS Configuration

Format

A config file is a plain text file in YAML format.

key: value

The default configuration file is /etc/vflow/mq.conf, you can be able to change it through vFlow configuration.

Configuration Keys

The NATS configuration contains the following key

KeyDefaultEnvironment variableDescription
urlnats://localhost:4222NAURL addresse

Raw Socket Configuration

Note that for messages sent over TCP and UDP using this producer, the message deliminator is a new line character ("\n").

Format

A config file is a plain text file in YAML format.

key: value

The default configuration file is /etc/vflow/mq.conf, you can be able to change it through vFlow configuration.

Configuration Keys

The rawSocket configuration contains the following key

KeyDefaultEnvironment variableDescription
urllocalhost:9555NAURL address to send to. Includes the hostname and port.
protocoltcpNAProtocol to use to send. Can be either "tcp" or "udp"
retry-max2NAThe number of times a message will be retried before giving up on it