@anthosz opened this Issue on September 25th 2020

Hi,

I use matomo 3.14.1 and I cannot use STDIN.

If I try (without stdin, it works):

python import_logs.py --idsite=1 --url='XXXXXX' --recorders=3 --
enable-http-errors --enable-http-redirects --enable-static --enable-bots --show-progress --show-progress-delay=10 --log-format-regex="(?P<ip>\S+) \[(?P<date>.*?) (?P<timezone>.*?)\] \"\S+ (
?P<path>.*?)\" (?P<status>.*)" access
0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Parsing log access...
^C
Logs import summary
-------------------
    968 requests imported successfully

If I try with this method (stdin method 1 / NOK):

# python import_logs.py --idsite=1 --url='XXXXXX' --recorders=3 --enable-http-errors --enable-http-redirects --enable-static --enable-bots --show-progress --show-progress-delay=10 --log-format-regex="(?P<ip>\S+) \[(?P<date>.*?) (?P<timezone>.*?)\] \"\S+ (?P<path>.*?)\" (?P<status>.*)" - < access
0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Logs import summary
-------------------
    0 requests imported successfully

If I try with this method (STDIN method 2 / NOK):

# cat access | python import_logs.py --idsite=1 --url='XXXXXX' --recorders=3 --enable-http-errors --enable-http-redirects --enable-static --enable-bots --show-progress --show-progress-delay=10 --log-format-regex="(?P<ip>\S+) \[(?P<date>.*?) (?P<timezone>.*?)\] \"\S+ (?P<path>.*?)\" (?P<status>.*)" -
0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Logs import summary
-------------------
    0 requests imported successfully

Seems that the file is empty according to output but it's full of lines (according of the test without stdin that works)...

Do you have an idea?

Best regards,

@tsteur commented on September 26th 2020 Member

Hi @anthosz are you using the latest version? I think this was fixed in https://github.com/matomo-org/matomo-log-analytics/pull/275

@anthosz commented on September 26th 2020

Hi @tsteur,

I confirm that yes, I use version 3.14.1.

Bestrehards,

@tsteur commented on September 27th 2020 Member

Thanks @anthosz I just checked and the fix was not included in the last release. It was fixed in https://github.com/matomo-org/matomo-log-analytics/pull/275

You could apply the patch by updating your importer by overwriting the import_logs.py with this content: https://raw.githubusercontent.com/matomo-org/matomo-log-analytics/3.x-dev/import_logs.py or by applying these changes: https://github.com/matomo-org/matomo-log-analytics/pull/275/files

@anthosz commented on September 27th 2020

Thank you @tsteur for your reactivity!

I will do it tomorrow!

@anthosz commented on September 28th 2020

I confirm, once patched, it works!

This Issue was closed on September 27th 2020
Powered by GitHub Issue Mirror