Hai all.....
I have a tcp dump file a darpa intrusion detection data set....I opened it thru a tool called Wireshark and i could see the columns as No,Time,Source ip,Destination ip,Protocol,Info......
Using this tool i converted the .tcpdump file int Comma seperated value(CSV) file...
My goal is to add the data set into sql server database....
when i wrote the c# code to add a csv file into database it showing an error called the file is not present in the directory....but actually the csv file is there but in unrecognized format...How do i rectify it...
Help me please.....
Loading
Posted Apr 14, 2009, 1:04 PM
I have successfully added the dump file into my database....wat i did was
first i opened the dump file using Wireshark tool then i stored it as .csv file..hope this not a prob for u...
Then in c# i used the following code...
SqlCommand command = new SqlCommand();
command.Connection = con;
command.CommandText = "BULK INSERT snort.dbo.[IncomingDataset]" + @" FROM 'c:\wednesday'" + "WITH" + "(" + "FIELDTERMINATOR = ','," + "ROWTERMINATOR='\n'" + ")";
command.CommandTimeout = 300;
command.ExecuteNonQuery();
Console.WriteLine("--------Dataset loaded sucessfully-------\n\n");
stored in sql server 2005
Here snort.dbo is the database name
Incomingdataset is the table name
c:/wednesday is the csv file.....
Hope i made myself clear..any doubt lemme know...
Md BabuPosted Apr 13, 2009, 3:44 PM
Have you stored the tcpdump into a database??
If yes, Please explain how?
How do you convert tcpdump to csv data?
Thanks.
Posted Jan 22, 2009, 10:42 PM
Thanks for the reply......anyway how can i post a file in this forum to show the csv file which i am working in.......
Thanks...
Bechir BejaouiPosted Dec 17, 2008, 5:17 PM
About stocking/retrieving a Blob file to/from a data base I suggest this Amr's article
Posted Dec 16, 2008, 11:28 PM
I dont know much about blob data type....and which one is easier n preferable to do....anyway i go for the last...adding the stock to each individual data column.....
Bechir BejaouiPosted Dec 16, 2008, 6:41 PM