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

Ability to set a custom field name in Discovery and Saved Searches #15246

Closed
marius-dr opened this issue Nov 29, 2017 · 17 comments
Closed

Ability to set a custom field name in Discovery and Saved Searches #15246

marius-dr opened this issue Nov 29, 2017 · 17 comments
Labels
Feature:Discover Discover Application release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@marius-dr
Copy link
Member

Right now, you can edit the column names in a Data Table visualization and any other visualization by setting the Custom Label field to what you want. It would be good to have the option to do that in Discover and Saved Searches as well, where in order to rename a field you would have to change the field in the mapping and reindex, right now.
Maybe an extra option in the field editor in Management like "Display name" would be a good way of doing it, but this is open to discussion.

@tom798
Copy link

tom798 commented Apr 18, 2018

In discover,can I edit the column names? In the version kibana 6.2.3?

@algefaen
Copy link

algefaen commented Jun 1, 2018

Since saved searches work a bit like visuazliations, I think it'd be reasonable to have a "custom column name" feature for saved searches ala the Custom Label feature in the visualizations. It looks like today a saved search columns is just a list of field names:

[ "columna", "columnb" ]

It should be preeetty easy app-logic-wise to extend that to support:

[ "columna", { "field": "columnb", "custom_name": "Column B"} ]

Other places it's been suggested to use a Data Table to workaround this lacking functionality, but that only works for numeric values, at least I can't figure out how to add a term as a data table value?

@bwalsh
Copy link

bwalsh commented Jun 5, 2018

+1 need exactly this

@PritomAhmed
Copy link

+1

1 similar comment
@jonathandick
Copy link

+1

@trevan
Copy link
Contributor

trevan commented Aug 15, 2018

@Bargs, I've looked into this and I think I can easily change the columns list to be similar to what @algefaen suggested. The only issue I have is that I don't know where to let the user specify the column name. One idea is to put it in the field name list on the left hand side. The field name list currently shows the list of selected fields at the top and when you click on it, it expands to show some summary data. I could put a text box there and then users can enter the custom label there. It would only affect the saved search, similar to how visualizations allow you to create custom labels.

@Bargs
Copy link
Contributor

Bargs commented Aug 16, 2018

My initial reaction is that field aliases should probably be a Kibana wide feature, and management of those aliases should go in the index pattern management screen. We could even lean on the field alias support coming to Elasticsearch (we'll need to support ES field aliases anyway).

My reasoning is that, for consistency's sake, a user would want to use the same name for a field throughout Kibana. Using different names for the same field in different saved searches would be confusing and opaque to consumers of those saves searches. I think visualizations are a little bit different because the custom labels are generally applied to aggregations of fields and not the fields themselves, so it's possible to give them more meaningful or shorter names. If we had global field aliases they would work across visualize and discover and there would be no more need to set custom labels on visualizations in the most simple cases.

Are there use cases where global field aliases would not solve your problem?

@trevan
Copy link
Contributor

trevan commented Aug 16, 2018

@Bargs, I would rather not lean on the field alias support since I think the list of valid characters for an ES field alias is limited and I'd like to be able to use all characters (especially non-ascii characters).

If you allow custom labels on visualizations (which I think you should even if you use the global aliases), I think you should also allow custom labels on saved searches. You can have the situation where you know that your saved search is going to be in a smaller space in the dashboard and so you want the name smaller than normal, or it will never be in a dashboard so you can ensure the name is as descriptive as possible.

@mnaor
Copy link

mnaor commented Aug 19, 2018

It will be very helpful to have this ability!

@Bargs
Copy link
Contributor

Bargs commented Aug 21, 2018

That's a good point, I can see how adjusting the column names based on the context the search will be viewed in could be useful. Putting the alias editor in the sidebar would work, but I wonder if it should be more connected to the doc table itself. Being able to edit the column name inline would feel more natural. On the other hand, we'd probably still want the name to update in the sidebar as well, so that might be kind of weird and unexpected for a change in the doc table to update the sidebar. What do you think @elastic/kibana-design ?

@AlonaNadler
Copy link

The only issue I have is that I don't know where to let the user specify the column name. One idea is to put it in the field name list on the left hand side.

I agree with @Bargs that filed aliases should be global, in many cases, we have multiple users using Kibana and I see this capability as an admins capability where they can change the field name to a more friendly name, so the right place to me will be in the index pattern page. I think changing the column name based on the search context is a different use case than what I often hear from users around friendlier names for fields

@Bargs, I would rather not lean on the field alias support since I think the list of valid characters for an ES field alias is limited and I'd like to be able to use all characters (especially non-ascii characters).

This is an interesting feedback, we can ask the Elasticsearch team to support it (cc: @jtibshirani )

@trevan
Copy link
Contributor

trevan commented Aug 21, 2018

I'm under the impression that this issue was solely about giving "custom labels" to the discover table and saved searches. These are non-global labels that are just needed for that specific search for various reasons.

A global field alias is fine as well since that allows you to give a more user friendly name across the board, but I believe another issue is covering that.

@jtibshirani
Copy link

@trevan I don't mean to bring this thread too off-topic, but I wanted to clarify what you meant by 'I think the list of valid characters for an ES field alias is limited'. It should be possible to specify non-ascii characters in field names (including names for field aliases) -- did you have a particular example in mind that elasticsearch wouldn't support?

@trevan
Copy link
Contributor

trevan commented Aug 21, 2018

@jtibshirani, I couldn't find the list of allowed characters in field names when I responded to @Bargs so I made an assumption that there is a limited set. But for labels on a saved search, I could see my users wanting to use strings in their preferred language and punctuation (especially quotation marks and periods). If ES supports the full utf8 spectrum for field aliases and field names, then that is something I didn't know before.

@jtibshirani
Copy link

jtibshirani commented Aug 21, 2018

Got it, thanks! I've actually found it difficult to track down the exact set of allowed characters as well :) I'll take another look and may loop back with an elasticsearch issue depending on the outcome.

@timroes timroes added Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed :Discovery labels Sep 16, 2018
@chrisregnier
Copy link

Has anything progressed here?

For the sake of moving things along without adding to the UI for now, I'd suggest adding the suggestions by algafaen to the Management / Kibana / Objects / Saved Searches edit dialog for the saved object.
It's definitely not discoverable, but at least it would enable the functionality to define the alias in the 'columns' edit box there and then display the name change in dashboards and tables. The UI for editing names while creating a search can be left for later.

@kertal
Copy link
Member

kertal commented Apr 23, 2021

Closing this , since assigning custom labels is possible via index pattern management, and with 7.13 you can do this directly in Discover
Bildschirmfoto 2021-04-23 um 14 31 04

@kertal kertal closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests