Skip to content

[BUG] Base labels values should probably be string (keyword), not object #68

@sgryphon

Description

@sgryphon

ECS schema version (e.g. 1.4.0):
1.5.0

ECS .NET assembly version (e.g. 1.4.2):
1.5.0

Elasticsearch version (if applicable):

.NET framework / OS:
Core 3.1 / Linux (or any)

Description of the problem, including expected versus actual behavior:
The Labels property is defined as IDictionary<string, object>, but should probably be IDictionary<string, string>

In the specification / YAML the type of labels is 'object', but I think that refers to the labels item itself, i.e. the dictionary is the object, not the contents.

The text of the specification defines the values as type 'keyword' (i.e string), and specifically states they should not be nested objects. The yaml also has a different property, object_type: keyword, that I think defines the type of the contents.

Allowing objects is obviously cooler, because there is semantic value in distinguishing between "5" and the number 5, etc, but I think the spec is that the values are supposed to be strings.

Steps to reproduce:

  1. Add a labels key/value with a scalar, e.g. int, or nested objects:
    logEvent.Labels.Add("Foo", 5);
    logEvent.Labels.Add("bar", new User() { Name = "waz" });

  2. See the JSON in Elastic / Kibana
    "labels": {
    "foo": 6,
    "bar": {
    "name": "waz"
    }
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions