-
Notifications
You must be signed in to change notification settings - Fork 119
Allow wildcards for importing logs #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@geographika I thought it is implemented by:
in https://github.com/piwik/piwik-log-analytics/blob/master/import_logs.py#L1990-L1992 or was i maybe mistaken? |
Thanks for the quick reply! Apologies for the first incorrect pull request (I left a print statement in). That only seems to be checking the
The files to process are gathered by:
And then looped through later on with:
The |
I see - it was probably working already here because linux bash will expand the *log and write the actual file names. Would it be possible to use the |
That would explain it. Yes I'm running this on a Windows server. I'd prefer The check for a * wildcard is a bit hacky though. Could any log filenames on linux contain a *? This isn't possible on Windows, but is technically possible on Unix - https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words |
import_logs.py
Outdated
@@ -824,7 +825,10 @@ def _parse_args(self, option_parser): | |||
if not self.filenames: | |||
print(option_parser.format_help()) | |||
sys.exit(1) | |||
|
|||
|
|||
if len(self.filenames) == 1 and '*' in self.filenames[0]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why writing len(self.filenames) == 1
, could we apply the glob when there are are more than 1 pattern specified?
Related to #104 - the docs say this is possible, but I can't see from the code how this is implemented.