How to access Azure log analytics via API - azure

I am using Azure log analytics to collect metrics for our Blob Storage account.
I have saved queries which I can run from Azure UI portal.
I want to access the same query results via API.
I couldn't find any decent documentation on how this can be done.
Can someone point me into right direction?
thanks

Related

Is there access log or metadata for Azure Data Catalog

Is there a way to access the metadata of Azure Data Catalog? I looked up the documentation and went through the Azure Activity log of Azure Data Catalog. However, it seems like there is no access activities(i.e. who accessed Azure Data Catalog at what point of time) log I can use. Is there such activity anywhere in Azure at the moment?
Unfortunately there is no such way to check the activity logs. I would recommend you to please have a look at Azure Purview which has updated Data Catalog features.
You can refer to this document which has describes how to configure metrics, alerts, and diagnostic settings for Azure Purview using Azure Monitor: Azure Purview metrics in Azure Monitor

where i can find azure logs for tracking api response

I want to view logs in azure, I mean logs that I have in the console in localhost where I can find them in web site deployed in azure? I am consuming an external API and I want to see what I send and what I received from the prod env
thank you
There are couple of ways to track logs in Azure
Azure API Management
Azure Monitor
Azure API Management helps you track all kinds of requests including
View activity logs
View resource logs
View metrics of your API
Set up an alert rule when your API gets unauthorized calls
Azure Monitor on the other hand helps it possible to programmatically retrieve the available default metric definitions, granularity, and metric values.
The data can be saved in a separate data store such as Azure SQL Database, Azure Cosmos DB, or Azure Data Lake. From there additional analysis can be performed as needed.

Searching Storage Account with Azure Log Analytics

Using Log Analytics, is it possible to search thru data stored in a container inside an Azure storage account? We have an Azure Function that reaches out to an API in O365 for log data and then it pushes that data into a storage account. We would like to be able to query this data.
We can push content inside your container to log analytics workspace repository using something called log analytics http data collector API.
We need to build your own integration of sending container content to log analytics by leveraging http data collector API.
You may refer to the suggestion mentioned in the article
https://learn.microsoft.com/en-us/azure/azure-monitor/platform/data-collector-api
Additional information: - Azure Functions
- Azure Automation
- Logic App
With any of these what you will do is have some schedule that will run on certain interval. When it is ran you will execute query against Log Analytics to get data. The results from the query you will transfer to Azure Storage may be as blob. You might have to do some transformation on the data depending on your scenario. The most important that you have to make sure is that you do not miss data or upload the same data twice to the storage. Log Analytics query language allows you to specify time frame for the results. I hope this will help you.
Kindly let us know if the above helps or you need further assistance on this issue.

Querying IIS logs from blob using Azure Log Analytics (formerly OMS)

I am attempting to use Azure Log analytics to query IIS logs that sit in four separate storage accounts (based on region) that are generated from our WebApps. Is this possible? I'm only seeing azure activity logs on my queries - I'm very new to log analytics, so any help would be greatly appreciated.
There is no direct way for this, you can take a look at this issue and it mentions:
Log Analytics is only supported at the IaaS (VM) level, not at PaaS (App Service) level.
If you want to do that, you can manually set up a way which sends the logs from blob storage to Log analytics, following this tutorial(It's a little hard to do that).
As well, you can also upvote on this feedback.

Can we fetch custom logs in Azure OMS

Our Project is a Java Spring boot application, We have a logging system using log4j, Which we are pushing into the Azure Storage accounts.
Question:
I want to query these custom logs in OMS. (Is it possible)
If Yes how.
Till now what i have tried is.
1. Pushed the logs in Blob storage using Logback and container looks like
Pushed logs in table storage
And configured Storage accounts in log analytics in Azure workspace
But i am unable to see any Analytic data to query in OMS .
Please help.
If you can't use Application Insights, you can read logs files from Storage and use HTTP Data Collector API to push logs into Log Analytics workspace. Samples and reference: https://learn.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api

Resources