Đang Thực Hiện

export logfiles to mySQL

Before you even start to think read this. Logfile doesnt have any special delimiter but only spaces!

Each logfile on FTP contains 0-XXX daily lines.

All logfiles have the same style of output, divided by space.

example of one logfile:

2007669 08:49:46 05-01-17 CODE-1 NUMERIC 760 text message and so on

1223353 08:49:47 05-01-17 CODE-4 ALPHA 760 text message and so on

1223354 08:49:54 05-01-17 CODE-4 ALPHA 760 text message and so on

1223353 08:53:00 05-01-17 CODE-4 NUMERIC 760 labore et dolore

1227355 08:57:02 05-01-17 CODE-1 ALPHA 760 consectetur adipiscing elit, sed do eiusmod tempor incididunt

1223353 08:58:51 05-01-17 CODE-3 ALPHA 760 Lorem ipsum dolor sit amet, sed do

what I would need in database is:

6 tables extracted from logfiles

example how TABLES should be built from last line of logfile

table1 contains 1223353 (unique number)

table2 contains 08:58:51 (time)

table3 contains 05-01-17 (date)

table4 contains CODE-3 (code[1-4])

table5 contains ALPHA 760 (ALPHA 760 or NUMERIC 760)

table6 contains Lorem ipsum dolor sit amet, sed do (text utf-8)

logfile names by date examples:

[url removed, login to view] - (2017 april 20)

[url removed, login to view] - (2017 april 19)

[url removed, login to view] - (2017 april 18)

working script on which you can continue to build on or create own:

foreach (glob("/path/to/logfiles/*.log") as $file) {

$file_handle = fopen($file, "r");

while (!feof($file_handle)) {

$line = fgets($file_handle);

echo $line;?>

<br />

<?php

}

fclose($file_handle);

}

Script at the moment only reads all logfiles and output them as text on website.

build php script that displays same results as this, just from mySQL ordered by date and time DESCENDING (newer first). All logfiles export to mySQL should happen on click of a button and cron job (1 min run) I will do cron job alone,

Filter the logs which are already in mySQL, so it does not upload them twice/multiple times when I click button (site load is slow). Caution last log file of a day is still updating/being written to (todays [url removed, login to view]).

Kỹ năng: MySQL, PHP

Xem thêm: php mysql excel export, mysql query export file, mysql trigger export phpmyadmin, php mysql csv export, oscommerce mysql import export, php mysql pdf export, mysql ldap export, export mysql excel, export mysql import mssql, ldap export mysql, sql export mysql, sql export mysql database, export mysql joomla component, mysql outlook export, mysql howto export, mysql php export excel, mysql excel export howto, export mysql pdf, php export mysql, php import export mysql, aspnet export mysql excel, export mysql outlook

Về Bên Thuê:
( 1 nhận xét ) Bled, Slovenia

Mã Dự Án: #13789328

Đã trao cho:

viveksingh96165

Its is not a Big deal and hence can easily write a script for this . The Thing which i need is 2 days time to proper test in different cases and load. 100% I can do this . If you think you want quality code then pi Thêm

€23 EUR trong 2 ngày
(1 Đánh Giá)
1.5

3 freelancer đang chào giá trung bình €23 cho công việc này

€23 EUR trong 1 ngày
(7 Đánh Giá)
3.6
holudare2076

Will deliver in a day

€23 EUR trong 1 ngày
(0 Đánh Giá)
0.0