-
Notifications
You must be signed in to change notification settings - Fork 74
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
Multiple Patterns #30
Comments
Please elaborate your requirement, @mthota15 |
I was able to do this way. from pygrok import Grok patterns = { def parse_type(text): for i in text: please let me know if there is a better way to do it with pygrok. |
+1 |
grok patterns are a superset of regex patterns. you can use a regex alternator group to match against 2 or more patterns like so: pattern = r'^(%{COMBINEDAPACHELOG}|%{COMMONAPACHELOG}|%{HTTPD_ERRORLOG})$'
parser = Grok(pattern) |
Does pygrok support matching of string against multiple patterns?
Any example on how to do that?
The text was updated successfully, but these errors were encountered: