Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for modifying json field names with dots in them in beats #5942

Closed
dl1ely opened this issue Dec 21, 2017 · 11 comments
Closed

Allow for modifying json field names with dots in them in beats #5942

dl1ely opened this issue Dec 21, 2017 · 11 comments
Labels
enhancement libbeat needs_team Indicates that the issue/PR needs a Team:* label Stalled

Comments

@dl1ely
Copy link

dl1ely commented Dec 21, 2017

Following the suggestion in https://discuss.elastic.co/t/allow-for-renaming-of-json-fields-in-http-module-output/112461 i open this issue to discuss the challenges regarding json field names with dots in them when these get collected/created by beats, especially metricbeat.

The problem is also described in https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703?source_topic_id=112461 and was already addressed in httpbeat, the predecessor of the metricbeat http module (https://github.com/christiangalsterer/httpbeat/blob/master/config/config.go#L34). Unfortunately, the http module does not allow a replacement of dots in json keys collected from the source.

The issue also surfaced in Spring Boot Actuator spring-projects/spring-boot#10449 but it affects other producers of metrics data too, and will not be fixed in Spring Boot 1.5

@christiangalsterer
Copy link
Contributor

@ruflin: If you have an idea/preference/suggestion how to address this I can have a look into it.

@ruflin
Copy link
Contributor

ruflin commented Dec 26, 2017

I think this is actually problem we have to solve in different places but probably have a method internally to do it. In general we should have a method replacing dot separated keys with _ as we already do for example for docker labels.

Here the different fixes we should do:

  • Jolokia: We should do it here by default as part of the metricset as it happens too often
  • http json metricset: Have a config option there
  • JSON processor: We should allow to do this as an option there too, which probably internally can be used by the http/ json metricset.

@christiangalsterer Would be great to have a PR for the http/json metricset, I will have a look at the jolokia one.

@ruflin
Copy link
Contributor

ruflin commented Dec 26, 2017

BTW here is the discussion from the Jolokia side: https://discuss.elastic.co/t/include-fields-problem/109809

@ruflin
Copy link
Contributor

ruflin commented Dec 26, 2017

@christiangalsterer You can use the dedot function introduced here: #5957

@christiangalsterer
Copy link
Contributor

@ruflin: Thanks for the info. Will have a look into the http/json metricset.

@ruflin
Copy link
Contributor

ruflin commented Dec 28, 2017

@christiangalsterer Awesome. Ping me if I can be of any help.

@walktall
Copy link
Contributor

Just like docker labels, add_kubernetes_metadata processors also need to handle k8s labels and annotations.

This method should also apply common.DeDot introduced in #5957 for keys of labelMap and annotationsMap.

@christiangalsterer
Copy link
Contributor

christiangalsterer commented Jan 1, 2018

PR #5970 available for http/json module.

ruflin added a commit to ruflin/beats that referenced this issue Jan 4, 2018
This should prevent name collisions and allow filtering on these fields. The feature is enabled by default and cannot be disable as otherwise ingestion could stop as Elasticsearch is returning an error. Currently not config option is provided as this should not be disabled.

* Introduces DeDot function in common package
* Adds tests to jmx for new functionality
* Use new function also for docker labels

Related to elastic#5942
Closes elastic#5916
andrewkroh pushed a commit that referenced this issue Jan 5, 2018
This should prevent name collisions and allow filtering on these fields. The feature is enabled by default and cannot be disable as otherwise ingestion could stop as Elasticsearch is returning an error. Currently not config option is provided as this should not be disabled.

* Introduces DeDot function in common package
* Adds tests to jmx for new functionality
* Use new function also for docker labels

Related to #5942
Closes #5916
@ruflin
Copy link
Contributor

ruflin commented Feb 11, 2018

Based on a discussion started about dots here (micrometer-metrics/micrometer#154 (comment)) I'm now thinking we probably need an additional conversion options to keep the dots but add .value or .count to the keys which conflict.

@botelastic
Copy link

botelastic bot commented Jul 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added Stalled needs_team Indicates that the issue/PR needs a Team:* label labels Jul 9, 2020
@botelastic
Copy link

botelastic bot commented Jul 9, 2020

This issue doesn't have a Team:<team> label.

@botelastic botelastic bot closed this as completed Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement libbeat needs_team Indicates that the issue/PR needs a Team:* label Stalled
Projects
None yet
Development

No branches or pull requests

4 participants