LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2012, 04:27 PM   #1
marcos egatz
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
TCPDUMP to MySQL


Hi guys,
I'm currently dealing with the dilemma of whether if is worthwhile to pipe the output of "tcpdump" command into a simple perl script, which will indeed do a select-query from myslq. Afterwards ( as a result from the previous logic) there's gonna be an insertion into a table (in the same mysql).
Have anybody tried/heard this as an effective approach? I need some advice because I haven't found much evidence on this topic.

Regards
 
Old 04-16-2012, 02:07 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
seems like a bizarre and contrived thing to want to do, but you'd given no reason as to why you'd want to for context.

Nothing to do with networking. Moved to Linux - Software
 
Old 04-16-2012, 07:48 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As acid_kewpie implied, it'd help if you explained a bit more about what you want to do and why.
For example, is this going to be an ongoing stream of tcpdump, or could you just dump to a file, then read that; you have to consider if the Perl prog will be able keep up with the incoming data flow.
 
Old 04-18-2012, 05:00 PM   #4
marcos egatz
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Chris,
As you've mentioned, streaming the output of tcpdump into a file plus using a Perl script, proved to be a suitable solution, which solved my requirement. But going back to the initial approach, it might be great if tcpdump had some way to store its output in a database just for logging purposes. But thinking a little bit in the aim of tcpdump itself, maybe it wasn't build with this usage in mind, because there are other better ways to do this (e.g. perl script).

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can MySQL log on via SSH/bash? mysql:x:27:101:MySQL Server:/var/lib/mysql:/bin/bash Ujjain Linux - Newbie 2 04-24-2009 02:21 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
Importing Snort's tcpdump into mysql toraghun Linux - Security 0 07-12-2006 08:06 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration