All Apps and Add-ons

Configuring Netflow App for Splunk

crt89
Communicator

Good day everyone,

I'm having trouble in configuring or setting up the Netflow app for Splunk.
I have already downloaded the nfdump and the splunk app in my machine(Linux Mint 64bit). Already put an ip address and udp port 9800 in my data inputs in splunk, also edited the config file of netflow

[nfcapd]
# UDP port to listen for incoming netflow.
#port = 9996
port = 9800

I have also chosen the sourcetype to be in netflow as said in the readme. Restarted splunk multiple times already. Still can't get results from the netflow app dashboards.

Can someone guide or help me to do this ? Is there something i need to input in linux command line in order for the dumps to capture. I'm currently pinging the ip and tcpdump on the linux machine. i tried running nfdump but it shows only this :

nfdump
Date flow start          Duration Proto      Src IP Addr:Port          Dst IP Addr:Port   Packets    Bytes Flows

Open file '<stdin>': bad magic: 0xA

Thanks fellow Splunkers

0 Karma
1 Solution

MarioM
Motivator

what do you mean by "downloaded the nfdump"? because it is already in the app

are you on 32bit OS?

By default, the NetFlow app only works on Linux 64-bit platforms (due to issues with nfdump binary compatibility). 

If you want to run this app on 32-bit platforms, rename two binary files "nfcapd_linux32" and "nfdump_linux32" to "nfcapd" and "nfdump", respectively. These files are located in the NetFlow app's "bin" directory, which is $SPLUNK_HOME/etc/apps/netflow/bin .

Following is an example of how to rename the files within the directory:

  $ cd $SPLUNK_HOME/etc/apps/netflow/bin
  $ mv nfcapd_linux32 nfcapd
  $ mv nfdump_linux32 nfdump

View solution in original post

MarioM
Motivator

what do you mean by "downloaded the nfdump"? because it is already in the app

are you on 32bit OS?

By default, the NetFlow app only works on Linux 64-bit platforms (due to issues with nfdump binary compatibility). 

If you want to run this app on 32-bit platforms, rename two binary files "nfcapd_linux32" and "nfdump_linux32" to "nfcapd" and "nfdump", respectively. These files are located in the NetFlow app's "bin" directory, which is $SPLUNK_HOME/etc/apps/netflow/bin .

Following is an example of how to rename the files within the directory:

  $ cd $SPLUNK_HOME/etc/apps/netflow/bin
  $ mv nfcapd_linux32 nfcapd
  $ mv nfdump_linux32 nfdump

crt89
Communicator

thanks again finally got it to work. using config.ini changed the port again and fully restart to take effect. ill rate it soon thanks

crt89
Communicator

ok i killed the nfcapd running then restarted the splunk server. after that i cant see any nfcapd running. also i received event counts to the netflow_si_traffic index but it stopped. also searching the index returns me with this event result : Return code =
Error: nfdump ran unsuccessfully. i think i still cant get it to work

0 Karma

crt89
Communicator

ok i used this : pgrep -l nfcapd then it showed 11208 nfcapd : then i tried to kill it and restarting splunk now. ill be back again in while to see if it works. thanks again for your help

0 Karma

MarioM
Motivator

maybe a last idea...can you make sure there is no nfdump or nfcapd processus running?
if it's feasible i would restart the server

0 Karma

MarioM
Motivator

unfortunately i have no more ideas...

0 Karma

crt89
Communicator

thanks again, ive used this netstat command
netstat -np udp 9800 | grep 9800

nothing shows.

0 Karma

MarioM
Motivator

and make sure there is no inputs.conf listening to this port.
because for me it looks the port is laready binded then you could try by setting another port in your netflow device and in config.ini

0 Karma

MarioM
Motivator

if you stop splunk and do netstat is there anything listening on the port you specified in the config.ini?

0 Karma

crt89
Communicator

im running in root and yes ive deleted the nfdump apt package

0 Karma

crt89
Communicator

[script://$SPLUNK_HOME/etc/apps/netflow/bin/nfcapd.py]
disabled = false
interval = 60
source = nfcapd.py
index=netflow_si_traffic

[script://./bin/nfdump.py]
disabled = false
interval = 60
source = nfdump.py
index=netflow_si_traffic

[monitor://$SPLUNK_HOME/etc/apps/netflow/log/nfdump]
disabled = false
sourcetype = netflow
blacklist = .\d+$
index=netflow_si_traffic

0 Karma

MarioM
Motivator

what's in your inputs.conf?

0 Karma

MarioM
Motivator

it sounds something is already listening on the port you specified in the config.ini (did you remove properly the nfdump apt package?) or you are not running splunk as sudo root.

0 Karma

crt89
Communicator

thanks again @MarionM here's what ive got

09-19-2012 15:33:48.963 +0800 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/netflow/bin/nfcapd.py" Terminated due to errors.

09-19-2012 15:34:48.751 +0800 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/netflow/bin/nfcapd.py" Receive socket error: could not open the requested socket

does this means its working ? do i need to configure more ?

0 Karma

MarioM
Motivator

index="_internal" sourcetype="splunkd" ("nfdump" OR "nfcapd")

look for any error

0 Karma

crt89
Communicator

restarted splunk already, how can i check if nfdump is working ? i have viewed the nfdump.log and it still blank

0 Karma

crt89
Communicator

ok , will feedback later thanks

0 Karma

MarioM
Motivator

then just remove the one you installed and all you need is to configure the $SPLUNK_HOME/etc/apps/netflow/default/config.ini and restart splunk

0 Karma

crt89
Communicator

im running in 64bit, i download the nfdump using apt-get. sorry i didnt know it was already in the app. forgot to indicate that im on 64bit.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...