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, e.g.would match
/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, e.g.
/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. e.g.
/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, e.g.
-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 within, e.g.
\. 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.