If you still intend to Collect text logs with Azure Monitor Agent, there isn't an out of box way to tagging the data being ingested with the source file name. The best suggestion I can think of is utilize the Log Ingestion API. Create a Logic App or Azure Function to convert the file payload into JSON, append the source file name as a property to that JSON, and then push the JSON data to a log ingestion API endpoint.
Read custom logs from a local file

Nitish Sharma
311
Reputation points
Hi,
I have to load multiple log files from server local drive to Azure Monitor, I was thinking to use one custom log for it as the format of files are same and all of them can be loaded in same table only but problem is I want to locate the file name on this custom log table to understand which file logged that entry. There is nothing like that in the file so have to make a custom entry in the table.
I don't want to publish the entries in table, intrested in using streaming capability only, has anyone tried it or knows how this can be achieved?