Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Azure Monitor Ingestion SDK for Python. Use for sending custom logs to Log Analytics workspace via Logs Ingestion API.
.claude/skills/azure-monitor-ingestion-py/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-16 | ✗→✓ | ▲ Improved | — | — |
| case-11 | ✗→✓ | ▲ Improved | — | — |
| case-10 | ✗→✓ | ▲ Improved | — | — |
| case-07 | ✗→✓ | ▲ Improved | — | — |
| case-03 | ✗→✓ | ▲ Improved | — | — |
Send custom logs to Azure Monitor Log Analytics workspace using the Logs Ingestion API.
bashpip install azure-monitor-ingestion pip install azure-identity
bash# Data Collection Endpoint (DCE) AZURE_DCE_ENDPOINT=https://<dce-name>.<region>.ingest.monitor.azure.com # Data Collection Rule (DCR) immutable ID AZURE_DCR_RULE_ID=dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Stream name from DCR AZURE_DCR_STREAM_NAME=Custom-MyTable_CL
Before using this SDK, you need:
pythonfrom azure.monitor.ingestion import LogsIngestionClient from azure.identity import DefaultAzureCredential import os client = LogsIngestionClient( endpoint=os.environ["AZURE_DCE_ENDPOINT"], credential=DefaultAzureCredential() )
pythonfrom azure.monitor.ingestion import LogsIngestionClient from azure.identity import DefaultAzureCredential import os client = LogsIngestionClient( endpoint=os.environ["AZURE_DCE_ENDPOINT"], credential=DefaultAzureCredential() ) rule_id = os.environ["AZURE_DCR_RULE_ID"] stream_name = os.environ["AZURE_DCR_STREAM_NAME"] logs = [ {"TimeGenerated": "2024-01-15T10:00:00Z", "Computer": "server1", "Message": "Application started"}, {"TimeGenerated": "2024-01-15T10:01:00Z", "Computer": "server1", "Message": "Processing request"}, {"TimeGenerated": "2024-01-15T10:02:00Z", "Computer": "server2", "Message": "Connection established"} ] client.upload(rule_id=rule_id, stream_name=stream_name, logs=logs)
pythonimport json with open("logs.json", "r") as f: logs = json.load(f) client.upload(rule_id=rule_id, stream_name=stream_name, logs=logs)
Handle partial failures with a callback:
pythonfailed_logs = [] def on_error(error): print(f"Upload failed: {error.error}") failed_logs.extend(error.failed_logs) client.upload( rule_id=rule_id, stream_name=stream_name, logs=logs, on_error=on_error ) # Retry failed logs if failed_logs: print(f"Retrying {len(failed_logs)} failed logs...") client.upload(rule_id=rule_id, stream_name=stream_name, logs=failed_logs)
pythondef ignore_errors(error): pass # Silently ignore upload failures client.upload( rule_id=rule_id, stream_name=stream_name, logs=logs, on_error=ignore_errors )
pythonimport asyncio from azure.monitor.ingestion.aio import LogsIngestionClient from azure.identity.aio import DefaultAzureCredential async def upload_logs(): async with LogsIngestionClient( endpoint=endpoint, credential=DefaultAzureCredential() ) as client: await client.upload( rule_id=rule_id, stream_name=stream_name, logs=logs ) asyncio.run(upload_logs())
pythonfrom azure.identity import AzureAuthorityHosts, DefaultAzureCredential from azure.monitor.ingestion import LogsIngestionClient # Azure Government credential = DefaultAzureCredential(authority=AzureAuthorityHosts.AZURE_GOVERNMENT) client = LogsIngestionClient( endpoint="https://example.ingest.monitor.azure.us", credential=credential, credential_scopes=["https://monitor.azure.us/.default"] )
The SDK automatically:
No manual batching needed for large log sets.
| Client | Purpose | |--------|---------| | LogsIngestionClient | Sync client for uploading logs | | LogsIngestionClient (aio) | Async client for uploading logs |
| Concept | Description | |---------|-------------| | DCE | Data Collection Endpoint — ingestion URL | | DCR | Data Collection Rule — defines schema, transformations, destination | | Stream | Named data flow within a DCR | | Custom Table | Target table in Log Analytics (ends with _CL) |
Stream names follow patterns:
Custom-<TableName>_CL — For custom tablesMicrosoft-<TableName> — For built-in tableson_error callback for partial failuresThis skill is applicable to execute the workflow or actions described in the overview.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.