Common Glob Patterns
Glob patterns specify sets of file names with wildcard characters. When you configure the Tetra File-Log Agent File Watcher Service, you can use glob patterns to monitor specified paths and detect changes in either certain files or folders.
IMPORTANT
It's recommended that you test your glob patterns by using a web application such as Glob tester before configuring them in the Tetra File-Log Agent.
Glob Pattern Syntax
The Tetra File-Log Agent supports the following glob syntax:
Patterns | Description |
---|---|
* | matches any number of characters including none, excluding directory separator |
** | match zero or more directories |
? | matches a single character |
/ -or- \ | path separators |
[abc] | matches one character in the brackets |
[!abc] | matches any character not in the brackets |
{abc,123} | comma-delimited set of literals, matched 'abc' or '123' |
NOTE
For alphabetical characters, only the standard 26 characters of the Latin alphabet are supported. Any alphabetical characters that aren't part of the standard Latin alphabet will cause data duplication.
Glob Pattern Examples
In the following examples, the path
defined in the config.json
is C:\temp\Source
.
Searching Folders
Pattern | Description |
---|---|
* | Return all of the folders at the current folder path (C:\temp\Source) |
A* | Return all of the folders at the current folder path (C:\temp\Source) with the folder name starting as A |
*/* | Return all of the folders at the first level under the current folder path (C:\\temp\\Source ) |
*/*/* | Return all of the folders at the second level under the current folder path (C:\\temp\\Source ) |
Logs | Get a specific folder Logs at the current folder path (C:\\temp\\Source ) |
** | Return all of the folders recursively under the current folder path by traversing down the current folder path (C:\\temp\\Source ) |
**/AuditTrail | Return all of the folder named as AuditTrail by traversing down the current folder path (C:\\temp\\Source ) |
**/*AuditTrail* | Return all of the folder named as AuditTrail by traversing down the current folder path (C:\\temp\\Source ) |
AuditTrail/2020-06-07 | Return the exact folder, C:\\temp\\Source\\AuditTrail\\2020-06-07 |
NOTE
When using the Folder Mode for File Watcher Service, if the pattern is empty, the Agent will monitor the path itself.
Searching Files
Pattern | Description |
---|---|
*.txt | Return all of the files with extension as txt at the current folder path (C:\\temp\\Source ) |
*.{log,txt} | Return all of the files with file extension either as .log or .txt at the current folder path (C:\\temp\\Source ) |
info*.txt | Return all of the files with the name starting with info at the current folder path (C:\\temp\\Source ) |
info?.txt | Return all of the files with the name starting with info and only has one character after that at the current folder path (C:\\temp\\Source ). Same examples: info2.txt, infoz.txt |
info[123a].txt | Return all of the files with the file name starting with info and only has one character after that. The matched character is among the characters of 1 , 2 , 3 or a . |
info[!123a].txt | Return all of the files with the file name starting with info and only has one character after that. The matched character is not any of the characters of 1 , 2 , 3 or a . |
[!~]*.txt | Return all of the files with file extension as txt and the file name doesn't start with ~. This pattern can be used to exclude the temp files generated by the Windows. |
**/* | Return all of the files by traversing down the current folder path (C:\temp\Source)) recursively |
**/EVO* | Return all of the files with file name starting with EVO by traversing down the current folder path (C:\temp\Source)) recursively |
**/*EVO* | Return all of the files with file name containing EVO by traversing down the current folder path (C:\temp\Source)) recursively |
**/{EVO,LOG,ERROR}* | Return all of the files with file name starting with EVO , LOG or ERROR , by traversing down the current folder path (C:\temp\Source)) recursively |
Documentation Feedback
Do you have questions about our documentation or suggestions for how we can improve it? Start a discussion in TetraConnect Hub. For access, see Access the TetraConnect Hub.
NOTE
Feedback isn't part of the official TetraScience product documentation. TetraScience doesn't warrant or make any guarantees about the feedback provided, including its accuracy, relevance, or reliability. All feedback is subject to the terms set forth in the TetraConnect Hub Community Guidelines.
Updated 19 days ago