Forum Discussion
jt-jt
Nov 07, 2024Copper Contributor
Can I use regex in a DCR custom text logfile filepath?
Hi, I have about 50 servers attached to a DCR to collect a custom text log into a log analytics workspace custom table. Is it possible or if anyone has experience with using a regex filepath in the...
Navid8102
Nov 07, 2024Copper Contributor
You may try :
- * (asterisk): Matches zero or more characters in a single directory level.
- ** (double asterisk): Matches zero or more characters across multiple directory levels.
"filePath": "/var/log/**/*.log"
{
"dataSources": {
"extensions": [
{
"name": "TextLogs",
"streams": [
"Microsoft-TextLogs"
],
"extensionName": "TextLogs",
"settings": {
"filePatterns": [
{
"filePath": "c:\\appserver\\logs\\*\\server\\*.log",
"format": "json"
},
{
"filePath": "c:\\appportal\\logs\\*\\portal\\*.log",
"format": "json"
}
]
}
}
]
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.OperationalInsights/workspaces/{workspace-name}"
}
]
}
}