|
i'm newbie to splunk and i'm trying to get splunk monitor a capture file from Wireshark. i set wireshark to capture traffic on a cap file and had splunk to monitor that file. I'm trying to see captured traffic and search inside that cap file to no avail. Any help? |
|
My approach that is used in a production environment and works like a charm, I should note that I am not reading a file I am collecting this live as it happens on an interface that is connected to a switch SPAN port. tshark_script.sh
I then install the Splunk Light Forwarder and have it monitor the /tshark/splunk/gtp/ directory. I have a cron that restarts tshark after a set period of time to avoid any memory/disk space issues and cleans up temp files. Sample log output
|
|
The default format for wireshark/tcpdump/tshark is not a text file format. The ".cap" pcap format is a binary one. Splunk won't have the intimate knowledge of the pcap binary format to be able to process it natively. From the manpage for tshark (command line wireshark):
|
|
Per this thread, it sounds like you can transform a .cap file to text using a command like this:
You could set up a Splunk scripted input using the command line above for one-time import of a single cap file. This doesn't help you for up-to-the-second packet capture, but with some scripting fu you could probably cut new tshark CAP files every so often (e.g. every hour) and then use the scripted approach above to transform each new file into the text that Splunk needs. |
