Integration Netflow with Splunk

Kernel Settings

Default Linux kernel settings may not be sufficient for high-volume packet capture, leading to potential data loss. To address this, update the kernel settings in your /etc/sysctl.conf file:

nano /etc/sysctl.conf
# Increase kernel buffer sizes for reliable packet capture
net.core.rmem_default = 33554432
net.core.rmem_max = 33554432
net.core.netdev_max_backlog = 10000

Reload the settings:

/sbin/sysctl -p

Prerequisites

  1. Install Go: https://go.dev/doc/install

  2. Create Index, Sourcetype, File

  • (Index) Settings → Indexes → New Index: Index Name: stream

  • (Sourcetype) Settings → Source types → New Source Type:

    Name: stream:netflow

    Category: Network & Security

    Indexed extractions: json

  • (File)

  1. Install goflow:

Netflow V9

Netflow V5

Monitor netflow file through universal forwarder

Add the following monitor stanza to inputs.conf:

Cronjob for Netflow

Edit the crontab:

Ensure no process is using UDP port 2055, kill if found. Then, reset netflow log and start Netflow V9:

Ensure no process is using UDP port 9995, kill if found. Then, reset netflow log and start Netflow V5:

Last updated