Results 1 to 5 of 5

Thread: How to convert log file data into sqlite database?

  1. #1
    Join Date
    Mar 2013
    Beans
    45

    How to convert log file data into sqlite database?

    previously is used log file to save data. Now I need to identify the variables which need to logged and save into sqlite database.Any idea on how to start?thanks

  2. #2
    Join Date
    Mar 2005
    Location
    Haarlem, The Netherlands
    Beans
    363

    Re: How to convert log file data into sqlite database?

    You can import a comma seperated text file directly in sqllite, see http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles. So the recipe would be to convert your logfile to a comma seperated file. Next create a table in sqllite with all the attributes of your log file, e.g. severity, date/time, source code line, error mesage. Finally import the logfile

  3. #3
    Join Date
    Mar 2013
    Beans
    45

    Re: How to convert log file data into sqlite database?

    Quote Originally Posted by Martin Witte View Post
    You can import a comma seperated text file directly in sqllite, see http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles. So the recipe would be to convert your logfile to a comma seperated file. Next create a table in sqllite with all the attributes of your log file, e.g. severity, date/time, source code line, error mesage. Finally import the logfile
    thanks for the information...can you show me the example of "create a table in sqllite with all the attributes of your log file, e.g. severity, date/time, source code line, error mesage."
    I'm not very know how to do it...thanks.

  4. #4
    Join Date
    Dec 2007
    Location
    Behind you!!
    Beans
    978
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to convert log file data into sqlite database?

    Quote Originally Posted by Newbie89 View Post
    thanks for the information...can you show me the example of "create a table in sqllite with all the attributes of your log file, e.g. severity, date/time, source code line, error mesage."
    I'm not very know how to do it...thanks.
    There is a simple example in the link that was posted.
    I suggest you read that first and then ask for further help if you're still having problems.

    Bodsda
    computer-howto
    Linux is not windows
    Fluxbox & Flux menu how to
    Programming is an art. Learn it, Live it, Love it!


  5. #5
    Join Date
    Mar 2013
    Beans
    45

    Re: How to convert log file data into sqlite database?

    Is it just identify the variable in the C file then create a table only to link it?Let say my C file got this variable as shown below:

    struct HOST
    {
    char Src_MAC[18];
    char Src_IP[16];
    long int Cap_Bytes;
    int TCP,UDP,ICMP,IP,ARP,OTH_Net, OTH_Trans; // Protocols
    int ftp,ssh,telnet,domain,www,netbios,other; // Services
    };

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •