-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] Implement logs data source context resolution #184079
Comments
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
Initial criteria for classifying a log data source
The above logic is already implemented for Logs Explorer and can be extracted for reuse into a package: buildIndexPatternRegExp. Warning We might want to rely on a hardcoded value initially, as this setting is specifically registered by an Observability project ( |
On the index patterns, I would like to extend it to For the specific fields, I suggest we lean on Last, we can take all the ECS logs fields as a strong indicator: https://www.elastic.co/guide/en/ecs/current/ecs-log.html @davismcphee What happens with the field caps if we have mixed data? For example if only part of the data has a |
BTW the comment here from @weltenwort covers the fields I have mentioned above in a nice summary: #184080 (comment) Lets start simple, we can always add more. |
This makes sense, we can extend the current index pattern-matching capability 👌 Regarding the fields, that might be more difficult to distinguish if a field applies to everything matching the pattern or just partially, because AFAIK the data view fields are merged and returns everything matching the pattern without making any grouping on them (e.g. The index pattern will be our strongest indicator at first, and then we can rely on ECS logs fields to double-check the match. |
@ruflin I looked into this today, and I believe there's a way through field caps, although it's a bit convoluted and I need verification from ES that my understanding is correct (I reached out to them in Slack for confirmation). In any case, this info isn't included by default in the data view field list, and adding it by default would cause a significant increase in data view field caps data transfer. I would suggest we create a utility to use in context resolution that sends a bespoke field caps request checking for only the fields we care about during context resolution, e.g. |
The danger of that is that a single bad index can "poison" a query - on field caps level we don't know whether an index will actually contribute to the shown result, so a one-off ill configured index in a broad index pattern could yank us out of logs mode for no good reason. One approach would be to only go by the index pattern for now and see how well that works in practice - especially if the field-level check is harder to do with an additional request. |
Related to this - we plan to introduce a central observability setting to define the "logs index patterns" which will be used by entity resolution as well. Should it be part of this as well? cc @tommyers-elastic - did this get created already? |
I agree with @flash1293, also given an index pattern match we surely know we do talk about logs (the strictness of the patterns matching on In case the index pattern doesn't strictly match our criteria, it can be really anything, particularly:
Even in the case the pattern might only refer to logs, it's non-trivial to know if the fields apply to all the patterns.
This is surely useful because it allows user to also specify their own logs patterns on top of the criteria defined above, which should help making a pattern like
I would keep this work split from this implementation, as it's split between the definition/implementation of this setting and its usage in Discover, we can use it as soon as it's ready in a following step to not block this work. |
Agreed @tonyghiani - opened a follow-up issue here: #184670 |
If the Logs UX team is aligned on this, it also works for me 👍 Starting simple and seeing how far we can get with the index pattern alone make sense to me. We can always revisit later if it ends up being insufficient. |
📓 Summary
The first data source profile supported by One Discover will be "logs". This issue covers the initial implementation of a logs
DataSourceProfileProvider
, primarily itsresolve
method. The aim should be to identify and broadly categorize logs as a data source category by inspecting the current ES|QL query or data view. Associated extension point implementations will be added later under separate issues.Some ideas of how we might implement this:
✔️ Acceptance criteria
DataSourceProfileProvider
with aresolve
method based on the defined heuristics.The text was updated successfully, but these errors were encountered: