Đã đóng

export logfiles to mySQL

Dự án này đã được trao cho viveksingh96165 với giá €23 EUR.

Nhận tin báo giá cho dự án tương tự
Ngân sách dự án
€8 - €30 EUR
Tổng đặt giá
Mô tả dự án

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 />





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]).

Được trao cho:
Các kỹ năng được yêu cầu

Muốn kiếm tiến?

  • Hạn định ngân sách và khung thời gian
  • Mô tả đề xuất của bạn
  • Nhận thanh toán cho công việc của bạn

Thuê những Freelancer đã đặt giá trong dự án này

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online