# Parse log file and fill a database

**URL:** <https://www.ruby-forum.com/t/parse-log-file-and-fill-a-database/96405>\
**Category:** Ruby\
**Created:** [June 28, 2006, 5:41pm UTC](https://www.ruby-forum.com/t/parse-log-file-and-fill-a-database/96405 "2006-06-28T17:41:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benhiller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@benhiller](https://www.ruby-forum.com/u/benhiller)\
**Post date:** [June 28, 2006, 5:41pm UTC](https://www.ruby-forum.com/t/parse-log-file-and-fill-a-database/96405/1 "2006-06-28T17:41:53Z")

</div>

Hello. I’m starting with ruby.  
I have Ã log file in which I managed to introduce some tags in order to  
extract informations more easily.  
i.e. :  
blabla  
uninteresting text  
…  
\<SOURCE\_IP\_ADRESS\>123.456.789.123\</SOURCE\_IP\_ADRESS\>  
.  
.  
.  
uninteresting text

I would like to place the string between tags in variables :date,  
ip\_source, etc. each time an attack occurs.  
Then I will place the content of the variables in a database.  
Then I will use Ror to make a beautiful visualisation tool !!  
How could I do to answer at my two first wishes?  
If it seems to you stupid to use tags in order to parse this log file,  
do you have another solution?  
Thanks a lot.  
Tainchebraye !
