Skip to content

[aws_logs] Remove fixed value from event.dataset mapping#15507

Merged
zmoog merged 2 commits intomainfrom
zmoog/fix/aws-logs/event-dataset-mapping
Oct 2, 2025
Merged

[aws_logs] Remove fixed value from event.dataset mapping#15507
zmoog merged 2 commits intomainfrom
zmoog/fix/aws-logs/event-dataset-mapping

Conversation

@zmoog
Copy link
Copy Markdown
Contributor

@zmoog zmoog commented Oct 1, 2025

Proposed commit message

Remove the constant value logs-aws_logs.generic from the event.dataset mapping.

Context

The Custom AWS Logs integration is an integration package, so it doesn't automatically create a new index template for each installation, as input packages do.

To overcome this single index template limit, users manually clone the logs-aws_logs.generic index template (for more context, see the comment) and adapt it for a custom dataset.

Unfortunately, all index template clones reference the same logs-aws_logs.generic@package component template that maps event.dataset as constant_keyword with a constant value of logs-aws_logs.generic. This means data streams created from the cloned index templates reject documents with event.dataset values other than logs-aws_logs.generic.

Changes

In this PR I removed the fixed value, but we have at least two options:

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

  • Install the Custom AWS Logs integration using aws_logs.custom as custom dataset.
  • Clone the logs-aws_logs.generic index template as logs-aws_logs.custom, setting the new index pattern as logs-aws_logs.custom-*.
  • Try to index a document in the Dev Tools using the following request:
POST logs-aws_logs.custom-default/_doc
{
  "@timestamp": "2025-10-01T13:39:29+02:00",
  "whatever": "yeah",
  "event": {
    "dataset": "aws_logs.custom"
  }
}

ES should index the document successfully.

Related issues

We can't assume event.dataset is always aws_logs.genericsince, users
commonly clone the index template.
@zmoog zmoog self-assigned this Oct 1, 2025
@zmoog zmoog added Integration:aws_logs Custom AWS Logs Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] bugfix Pull request that fixes a bug issue labels Oct 1, 2025
@zmoog zmoog changed the title [azure_logs] Remove fixed value from event.dataset mapping [aws_logs] Remove fixed value from event.dataset mapping Oct 1, 2025
@zmoog zmoog marked this pull request as ready for review October 1, 2025 18:11
@zmoog zmoog requested a review from a team as a code owner October 1, 2025 18:11
@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

cc @zmoog

@zmoog zmoog merged commit 6b8adbf into main Oct 2, 2025
7 checks passed
@zmoog zmoog deleted the zmoog/fix/aws-logs/event-dataset-mapping branch October 2, 2025 08:26
@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

Package aws_logs - 1.8.3 containing this change is available at https://epr.elastic.co/package/aws_logs/1.8.3/

agithomas pushed a commit to agithomas/integrations that referenced this pull request Oct 30, 2025
Remove the constant value `logs-aws_logs.generic` from the `event.dataset` mapping. 

**Context**

The Custom AWS Logs integration is an integration package, so it doesn't automatically create a new index template for each installation, as input packages do.

To overcome this single index template limit, users manually clone the `logs-aws_logs.generic` index template (for more context, see the [comment](elastic#13433 (comment))) and adapt it for a custom dataset.

Unfortunately, all index template clones reference the same `logs-aws_logs.generic@package` component template that maps `event.dataset` as `constant_keyword` with a constant value of `logs-aws_logs.generic`. This means data streams created from the cloned index templates reject documents with `event.dataset` values other than `logs-aws_logs.generic`.

**Changes**

In this PR I removed the fixed value, but we have at least two options:

- We can keep the `event.dataset` mapping as `constant_keyword` without the fixed value to `logs-aws_logs.generic`.
- Change the mapping to `keyword` to align with ECS https://www.elastic.co/docs/reference/ecs/ecs-event#field-event-dataset to give users more flexibility.
tehbooom pushed a commit to tehbooom/integrations that referenced this pull request Nov 19, 2025
Remove the constant value `logs-aws_logs.generic` from the `event.dataset` mapping. 

**Context**

The Custom AWS Logs integration is an integration package, so it doesn't automatically create a new index template for each installation, as input packages do.

To overcome this single index template limit, users manually clone the `logs-aws_logs.generic` index template (for more context, see the [comment](elastic#13433 (comment))) and adapt it for a custom dataset.

Unfortunately, all index template clones reference the same `logs-aws_logs.generic@package` component template that maps `event.dataset` as `constant_keyword` with a constant value of `logs-aws_logs.generic`. This means data streams created from the cloned index templates reject documents with `event.dataset` values other than `logs-aws_logs.generic`.

**Changes**

In this PR I removed the fixed value, but we have at least two options:

- We can keep the `event.dataset` mapping as `constant_keyword` without the fixed value to `logs-aws_logs.generic`.
- Change the mapping to `keyword` to align with ECS https://www.elastic.co/docs/reference/ecs/ecs-event#field-event-dataset to give users more flexibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:aws_logs Custom AWS Logs Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants