{"id":23331,"library":"azure-log-analytics-data-collector-api","title":"Azure Log Analytics Data Collector API Client","description":"Unofficial Python client for the Azure Log Analytics Data Collector API (HTTP Data Collector API). Version 0.4.0 adds configurable endpoint. Infrequently updated; use for custom log ingestion where the official Azure Monitor SDK is not required.","status":"active","version":"0.4.0","language":"python","source_language":"en","source_url":"https://github.com/yokawasa/azure-log-analytics-data-collector-python","tags":["azure","log-analytics","data-collector","custom-logs"],"install":[{"cmd":"pip install azure-log-analytics-data-collector-api==0.4.0","lang":"bash","label":"Latest version"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false}],"imports":[{"note":"Package uses underscores, not dots.","wrong":"from azure.log.analytics.data.collector import LogAnalyticsDataCollectorClient","symbol":"LogAnalyticsDataCollectorClient","correct":"from azure_log_analytics_data_collector_api import LogAnalyticsDataCollectorClient"}],"quickstart":{"code":"import os\nfrom azure_log_analytics_data_collector_api import LogAnalyticsDataCollectorClient\n\nworkspace_id = os.environ.get('AZURE_WORKSPACE_ID', '')\nshared_key = os.environ.get('AZURE_SHARED_KEY', '')\nclient = LogAnalyticsDataCollectorClient(workspace_id, shared_key)\n\nrecords = [{\"name\": \"test\", \"value\": 1}]\nresponse = client.send(records, log_type='MyCustomLog_CL')\nprint(response.status_code)","lang":"python","description":"Creates client and sends custom log data. Remember to configure retention and custom log fields in Azure Portal."},"warnings":[{"fix":"Use log_type='MyLog' (not 'MyLog_CL'). The client does NOT add the suffix automatically; Azure adds it server-side.","message":"Log type name must be alphanumeric plus underscore, max 100 characters. It is automatically suffixed with '_CL' by Azure, but DO NOT include '_CL' yourself in the parameter.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Always use the default endpoint for public Azure ('https://<workspace-id>.ods.opinsights.azure.com') or explicitly verify your custom endpoint.","message":"The client does not validate the endpoint URL. If you pass an incorrect or non-Azure endpoint, the request will silently fail with a non-descriptive error.","severity":"gotcha","affected_versions":"0.4.0"},{"fix":"Consider migrating to `azure-monitor-ingestion` (package: azure-monitor-ingestion) which is actively maintained.","message":"This library is based on the deprecated Azure Log Analytics Data Collector API. Microsoft recommends using the official azure-monitor-ingestion library for new projects.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install: pip install azure-log-analytics-data-collector-api. Then import: from azure_log_analytics_data_collector_api import LogAnalyticsDataCollectorClient","cause":"Package not installed or wrong import path.","error":"from azure_log_analytics_data_collector_api import LogAnalyticsDataCollectorClient\nModuleNotFoundError: No module named 'azure_log_analytics_data_collector_api'"},{"fix":"Verify workspace ID and shared key from Azure Portal. Ensure the log type is correctly configured (custom log must be created in Azure Portal).","cause":"Incorrect workspace ID or shared key, or missing permissions.","error":"requests.exceptions.HTTPError: 403 Client Error: Forbidden"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}