-
Notifications
You must be signed in to change notification settings - Fork 74
feat: display select fields in search results #2988
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
feat: display select fields in search results #2988
Conversation
cb3db79 to
759db1a
Compare
@msmithstubbs can we adjust the ui to something like this:
- action button links below the selected fields (if any), otherwise inline with the event message
- shift the field path to be in the timestamp column and styled as label - no opinion on colors, though secondary or link-red might work.
haven't reviewed code yet, but copying the log line should also copy the selected fields |
Ziinc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly styling adjustments
|
|
||
| assert html =~ "metadata.user_id:" | ||
| assert html =~ "user_123" | ||
| assert html =~ "metadata.store.city:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also consider long field paths, in case it execeds timestamp col width, would need to truncate with ...
| phx-click={ | ||
| JS.dispatch("logflare:copy-to-clipboard", | ||
| detail: %{ | ||
| text: "#{LogflareWeb.SearchLive.LogEventComponents.formatted_timestamp(log, assigns[:search_timezone])} #{log.body["event_message"]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woudl need to include selected fields, each as a new line.
my.field: value
long_field:
.....
`
- inline if <=64 char
- newline if longer
Moved the field names under timestamp and links under select fields. The select field name is truncated in the middle if too long. How's that now @Ziinc ? (Haven't updated the code yet.) |
|
@msmithstubbs can we take the first key and last key? truncating the middle key halfway looks odd |
|
yes lets go with the last field of the path. for the case where the field is long, then we can simply truncate, that is fine. |
48a5e20 to
fdd253d
Compare
fdd253d to
d914b73
Compare
53cdac0 to
a864576
Compare



This PR adds support for displaying fields selected as part of a query in the search results list.
The last nested path key is used as the label, unless an alias is specified. Labels are truncated if necessary.
If a select rule is used the modal link (view, context, etc) are moved underneath the select fields.
They remain inline, after the log event message, when select rules are not used.
Also