All Apps and Add-ons

Splunk Add-on for Netflow

edwardrose
Contributor

Hello All,

I have installed Splunk App for NetFlow and ran the configure.sh script. But the flowfix.sh script seems to be a little off.
#!/bin/bash

# Listener command for nfcapd 1 - v5 - -b IPV4 - 9955
if [ ! -f /opt/splunk/etc/apps/Splunk_TA_flowfix/bin/nfcapd-1-v5--b/opt/splunk/etc/apps/Splunk_TA_flowfix/bin/Linux_x86_64_core2/nfcapd -p 9955 -bfi

# Listener command for nfcapd 2 - v9 - -b IPv4 - 9939
if [ ! -f /opt/splunk/etc/apps/Splunk_TA_flowfix/bin/nfcapd-2-v9--b/opt/splunk/etc/apps/Splunk_TA_flowfix/bin/Linux_x86_64_core2/nfcapd -p 9939 -bfi

# Listener command for nfcapd 3 - v9 - -b IPv4 - 9949
if [ ! -f /opt/splunk/etc/apps/Splunk_TA_flowfix/bin/nfcapd-3-v9--b/opt/splunk/etc/apps/Splunk_TA_flowfix/bin/Linux_x86_64_core2/nfcapd -p 9949 -bfi

# Listener command for nfcapd 4 - IPFIX - -b IPv4 - 9910
if [ ! -f /opt/splunk/etc/apps/Splunk_TA_flowfix/bin/nfcapd-4-IPFIX--b/opt/splunk/etc/apps/Splunk_TA_flowfix/bin/Linux_x86_64_core2/nfcapd -p 9910 -bfi

# This part converts the binary flows to csv/ascii
if [[ `find /opt/splunk/etc/apps/Splunk_TA_flowfix/nfdump-binary/* | grep nfcapd.2` ]]; then

FILES=`ls /opt/splunk/etc/apps/Splunk_TA_flowfix/nfdump-binary/*/nfcapd.2*`

for FILE in ${FILES[*]}
do
/opt/splunk/etc/apps/Splunk_TA_flowfix/bin/Linux_x86_64_core2/nfdump -qr "$FILE" -o csv >> /opt/splunk/etc/apps/Splunk_TA_flowfix/nfdump-ascii/nfdump-csv_`date +"%Y%m%d%H%M%S"`.log && rm "$FILE"
done;
fi

# Cleanup files older than -1
find /opt/splunk/etc/apps/Splunk_TA_flowfix/nfdump-ascii -type f -mtime +-1 -exec rm -f {} \;

The Listener lines seem to be incomplete and when the script runs all I get is unexpected end of file. To me it looks like all he if statements in the listeners are incomplete. Is this a bug that the configure script did not setup properly?

[root@splk-gns-fwd-01 bin]# ./flowfix.sh
./flowfix.sh: line 28: syntax error: unexpected end of file
[root@splk-gns-fwd-01 bin]#

Any help is appreciated.

Thanks
ed

0 Karma
1 Solution

edwardrose
Contributor

Splunk ticket was created and it appears that the script is sort of unclear when it asks IPv4, IPv6 or all. I guess you are suppose to enter an IP address or leave blank for all. Once I left the answer blank for all the script completed correctly. I was mistakenly entering IPv4 instead of an actual IP address

View solution in original post

edwardrose
Contributor

Splunk ticket was created and it appears that the script is sort of unclear when it asks IPv4, IPv6 or all. I guess you are suppose to enter an IP address or leave blank for all. Once I left the answer blank for all the script completed correctly. I was mistakenly entering IPv4 instead of an actual IP address

jcoates_splunk
Splunk Employee
Splunk Employee

what shell does your Linux use? Just verified that this works fine on bash in CentOS 6.4.

0 Karma

edwardrose
Contributor

CentOs 6.5 bash

0 Karma

jcoates_splunk
Splunk Employee
Splunk Employee

Probably worth a support ticket so we can diagnose properly; that seems like a shell problem, but bash is what we test with and there've been no other complaints against this heavily used Add-on.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...