Read custom logs from a local file

Nitish Sharma 336 Reputation points
2023-03-07T09:07:33.7633333+00:00

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?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,826 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 26,136 Reputation points Microsoft Employee
    2023-03-11T05:13:59.86+00:00

    Hi @Nitish Sharma

    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.

    0 comments No comments