elastic / elastic/logstash

tagging inconsistencies

Open
#6,184 6 comments 0 reactions 0 assignees View on GitHub
discuss v6.0.0
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

The tagging concept and the `tags` field usage would benefit some thoughts and a properly defined API for the future (6.0?).

Some problems have been identified in #6142 and are being solved in #6177.

There is one inconsistency issue I'd like to discuss now to see if this is something we should fix in a minor/bugfix release.

- the `Event#tag` / `Event.tag()` methods deduplicates the `tags` field list, meaning that it will only insert the given tag in the `tags` field list only if it is not already in that list.

but

- the config `add_tag` directive does not do deduplication. The same tag can be inserted in the `tags` field multiple times.

Should we also do deduplication in the config `add_tag` ? if so, are there chances this break current configurations?

Otherwise, the larger problem here is that the `tags` field has never been properly considered a "reserved" field with a "defined" API, like `@timestamp` for example. so it is totally possible for anyone to place arbitrary values in the `tags` field but on the other hand, a lot of plugins rely on the existence and "validity" of the `tags` field.

I'd like open up the discussion on the best way to address this moving forward. Is it to simply define a new `@tags` field with a clear API? this would require changes is configurations? code sweep across plugins would also be necessary.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the deduplication behavior of Event#tag/Event.tag() with the config add_tag directive, then review the related discussion in #6142 and #6177. Done requires agreement on whether duplicate tags should be removed and on a clearly defined tags API, including the configuration and plugin impact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.