Logging Regex Pattern Hints¶
Glob regex patterns¶
There are a few ways to specify a generic path where users have got logs that need to be picked up by the log matcher mechanism:
?is expanded to match a single character in the file name.
/home/app/server/custom_logs/bat.log /home/app/server/custom_logs/cat.log /home/app/server/custom_logs/hat.log
*is expanded to match 0 or more characters in the file name. This way users can search any folder within the current directory and pick filenames from within.
/home/app/server/custom_logs/monday/assets.log /home/app/server/custom_logs/tuesday/revenue.log /home/app/server/custom_logs/tuesday/assets.log
**expands to match 0 or more folders in the path and follows any rules specified after the wildcard. Unlike the single asterisk it searches directories recursively and picks any file that match the specified rule.
/home/app/server/custom_logs/schedule.log /home/app/server/custom_logs/monday/assets.log /home/app/server/custom_logs/monday/address/properties.log /home/app/server/custom_logs/tuesday/assets.log /home/app/server/custom_logs/tuesday/revenue.log
Character classes and ranges¶
Defining a range can be done using the square brackets operator
[ ... ]. They are expanded to match a single character specified that are enclosed within.
-within the square brackets. Ranges can be a mixture of upper and lower letters and/or numbers, e.g.
Users can define to exclude a character by using the expression
[! ... ]. This would match any character apart from the ones specified withing.
All these special characters can be escaped by using
\. So if the operating system allows the users to have a
* in the file name, the regex can match it by adding
\* to the glob expression.
Need more help?
Contact support in the chat bubble and let us know how we can assist.