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,
Hi @anthosz are you using the latest version? I think this was fixed in https://github.com/matomo-org/matomo-log-analytics/pull/275
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
Thank you @tsteur for your reactivity!
I will do it tomorrow!