elastic / elastic/integrations

[Azure Logs]: `remove` processor conditional doesn't use optional chaining

Open
#14,747 1 comment 0 reactions 0 assignees View on GitHub
Integration:azure needs:triage Stalled Team:obs-ds-hosted-services
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
2d 17h
Merged PRs (30d)
225

Description

### Integration Name

Azure Logs [azure]

### Dataset Name

_No response_

### Integration Version

1.28.1

### Agent Version

8.17.5

### Agent Output Type

elasticsearch

### Elasticsearch Version

8.17.5

### OS Version and Architecture

ECH

### Software/API Version

_No response_

### Error Message

The `logs-azure.platformlogs-1.28.1` pipeline has a `remove` processor that doesn't use optional chaining:

```
ctx.azure.platformlogs.properties != null
```

[link](https://github.com/elastic/integrations/blob/98d4d8af964ffed7d71fc8648439a0095b32342f/packages/azure/data_stream/platformlogs/elasticsearch/ingest_pipeline/default.yml#L108-L112)

If the event lacks this field and the condition fails, the processor fails so the pipeline's `on_failure` condition kicks in and will present a confusing error message:

```json
{
"error": {
"message": "Processor \"conditional\" with tag \"\" in pipeline \"logs-azure.platformlogs-1.28.1\" failed with message \"cannot access method/field [platformlogs] from a null def reference\""
}
}
```

### Event Original

_No response_

### What did you do?

Out of the box config.

### What did you see?

Error message above.

### What did you expect to see?

The condition to bail gracefully.

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.