I have a internal portal with Kibana-Elastic search for log management and I have a set of fields. Can anyone tell me how to form a query along with the search phrase to retrieve & show only specified fields as results in it.
Thank you.
I have a internal portal with Kibana-Elastic search for log management and I have a set of fields. Can anyone tell me how to form a query along with the search phrase to retrieve & show only specified fields as results in it.
Thank you.
In order to return only the specific fields which you want in your response, you could do something like this within the request body:
"size" : 10, <------ you can have this or leave it out
"_source": ["chargeamount"], <------ the field you wanted to get
"query":{
"query_string":{
"query":"" <------ your query after the _search in your url goes here
}
}
You could have a look at this SO as well for more explanation.
Also, if for you the matter is only visible fields in Discover and not the fields returned by the search you can customize search results table in the settings but in columns text aria (See screenshot).
Slightly on the similar lines, when we try to create a saved search the Discover tab will show a column with time stamp details, if you want to hide that entire field you can go to Stack Management -->Advance Settings and toggle the "Hide 'Time' column" flag from UI, this will hide the time stamp column and helps you to include only selective columns of your choice in saved search by keeping the time stamp column hidden based on what I understood from https://github.com/elastic/kibana/issues/3319