[Logs UI] Fixes missing fields in the log entries search strategy#94443
Merged
weltenwort merged 1 commit intoelastic:masterfrom Mar 12, 2021
Merged
Conversation
…es search strategy
Contributor
|
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
weltenwort
approved these changes
Mar 11, 2021
Member
weltenwort
left a comment
There was a problem hiding this comment.
LGTM - thank you for the quick fix!
| configuration.fields.timestamp, | ||
| configuration.fields.tiebreaker, | ||
| messageFormattingRules.requiredFields, | ||
| getRequiredFields(configuration, messageFormattingRules, params.columns), |
Member
There was a problem hiding this comment.
What do you think about branching between column overrides and config here? This would match the getLogEntryFromHit signature more closely.
Suggested change
| getRequiredFields(configuration, messageFormattingRules, params.columns), | |
| getRequiredFields( | |
| params.columns ?? configuration.logColumns, | |
| messageFormattingRules | |
| ), | |
| .map(getLogEntryFromHit(configuration.logColumns, messageFormattingRules)); | ||
| .map( | ||
| getLogEntryFromHit( | ||
| request.params.columns ? request.params.columns : configuration.logColumns, |
Member
There was a problem hiding this comment.
Nit alert! 😉
Suggested change
| request.params.columns ? request.params.columns : configuration.logColumns, | |
| request.params.columns ?? configuration.logColumns, |
Comment on lines
+259
to
+265
| const getRequiredFields = ( | ||
| configuration: LogSourceConfigurationProperties, | ||
| messageFormattingRules: CompiledLogMessageFormattingRule, | ||
| columnOverrides?: LogSourceColumnConfiguration[] | ||
| ): string[] => { | ||
| const columns = columnOverrides ? columnOverrides : configuration.logColumns; | ||
|
|
Member
There was a problem hiding this comment.
(if we wanted to align the signatures as proposed above)
Suggested change
| const getRequiredFields = ( | |
| configuration: LogSourceConfigurationProperties, | |
| messageFormattingRules: CompiledLogMessageFormattingRule, | |
| columnOverrides?: LogSourceColumnConfiguration[] | |
| ): string[] => { | |
| const columns = columnOverrides ? columnOverrides : configuration.logColumns; | |
| const getRequiredFields = ( | |
| columns: LogSourceColumnConfiguration[], | |
| messageFormattingRules: CompiledLogMessageFormattingRule | |
| ): string[] => { |
Member
|
After consulting with @Kerry350 I'll merge this as it is and defer the suggested changes to a follow-up. |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 12, 2021
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 12, 2021
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes #94324. Fields from columns are now added to the log entries search strategy request. Log column overrides will also take precedence over those in the source configuration.