Skip to content

Commit d2b6845

Browse files
Update data-collection-text-log.md
1 parent 3457212 commit d2b6845

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

articles/azure-monitor/agents/data-collection-text-log.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ The table created in the script has two columns:
4747

4848
- `TimeGenerated` (datetime) [Required]
4949
- `RawData` (string) [Optional if table schema provided]
50+
- 'FileName' (string) [Optional]
5051
- `YourOptionalColumn` (string) [Optional]
5152

52-
This is the default table schema for log data collected from text files. If you know your final schema or your source is a JSON log, you can add the final columns in the script before creating the table. You can always [add columns using the Log Analytics table UI](../logs/create-custom-table.md#add-or-delete-a-custom-column) later.
53+
The default table schema for log data collected from text files is 'TimeGenerated' and 'RawData'. Adding the 'FileName' to either team is optional. If you know your final schema or your source is a JSON log, you can add the final columns in the script before creating the table. You can always [add columns using the Log Analytics table UI](../logs/create-custom-table.md#add-or-delete-a-custom-column) later.
5354

5455
Your columns names and JSON attributes must exactly match to be automatically parse into the table. Both columns and JSON attributes are case sensitive. For example `Rawdata` will not collect the event data. It must be `RawData`. Ingestion will drop JSON attributes that do not have a corresponding column.
5556

@@ -72,9 +73,13 @@ $tableParams = @'
7273
"name": "RawData",
7374
"type": "String"
7475
},
76+
{
77+
"name": "FileName",
78+
"type": "String"
79+
},
7580
{
76-
"name": `"YourOptionalColumn"` ,
77-
"type": "string"
81+
"name": `"YourOptionalColumn",
82+
"type": "String"
7883
}
7984
]
8085
}
@@ -199,6 +204,10 @@ To create the data collection rule in the Azure portal:
199204
"name": "RawData",
200205
"type": "string"
201206
},
207+
{
208+
"name": "FileName",
209+
"type": "String"
210+
},
202211
{
203212
"name": "YourOptionalColumn" ,
204213
"type": "string"
@@ -278,6 +287,10 @@ To create the data collection rule in the Azure portal:
278287
"name": "TimeGenerated",
279288
"type": "datetime"
280289
},
290+
{
291+
"name": "FileName",
292+
"type": "String"
293+
},
281294
{
282295
"name": "YourFirstAttribute",
283296
"type": "string"

0 commit comments

Comments
 (0)