Kibana textbox instead of dropdown - elasticsearch

To create a new Kibana visualization I select "Controls" from the "New Visualization" section:
Viewing the "Controls" section:
An option does not appear to exist to add a "text field" , all field types are dropdowns. How to add a searchable text field type to a visualization ?
The reason I'm attempting to add a text field instead of a dropdown field is that the number of records returned by the field in question exceeds 1'000'000 and therefore I do not want to populate all data for performance reasons.
Up to this point I use kibana.autocompleteTerminateAfter and set the value to the number of data points stored in elastic for the field. I'm concerned that as more records are added to elastic the performance of loading the Kibana search page will decrease as kibana.autocompleteTerminateAfter will require updating as new records are added and could at some point be set to kibana.autocompleteTerminateAfter : 10000000
From https://www.elastic.co/guide/en/kibana/current/settings.html :

Related

How can I create a list of values for a field in Kibana?

I am using Kibana to view data from Elasticsearch index. There is a field only has a few values. When I do search the field, how can I make the search bar as a select rather than a free text input? I know that there is a filter list like below image:
but it doesn't work for the case that top 5 values in 500 records have one value. How can I show all values in the history as a list for a field?
I think your are looking for "controls" visualization.
Go to visualization > controls
Then choose option list, your index and your field.
The result will be a dropdown with values like if you did a select distinct on your field within the whole kibana range.
Add it to a dashboard to have a filtering interface human usable dashboard.
Update:
Maybe a simple filter on the discover page can answer to your question.

how kibana can create a dashboard which sum the column of some log record

I have a request which sum the core and memory of specify jobs, the origin data about core and memory have been put in the elk logs. Like as below picture.
First red column is core data, the second column is memory data, third red column is job name. Now I want to sum the "core" or "memory" by filtering specify jobs and create a dashboard in kibana. As the dashboard, x-axis is 'time', y-axis is sum of 'core' or 'memory'.
I don't know how to sum the column in elk and create dashboard, someone who can help me, thank you so much.
You need to add a scripted field which will add a field at runtime in every document by operations on your current field.
After creating an index pattern , go to that index pattern in settings tab in got to scripted fields tab and a new scripted field.
Name the field which will appear while making the visualisation and add the script as follows.
Here is how to make a script
https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-request-script-fields.html
And here is a link of how you can do that in kibana
https://www.elastic.co/guide/en/kibana/current/scripted-fields.html

Grafana - Show metric by field value

I'm currently trying to create a graph on Grafana to monitor the status of my servers, however, I can't seem to find a way to use the value of a field as the value to be displayed on the graph. (Datasource is ElasticSearch)
The following "document" is going to be sent to GrayLog (which saves to Elastic) every 1 minute for an array of regions.
{
"region_key": "some_key",
"region_name": "Some Name",
"region_count": 1610
}
By using the following settings, I can get Grafana to display the count of messages it received for each region, however, I want to display the number on the region_count field instead.
Result:
How can I accomplish this? is this even possible using Elastic as the datasource?
1) Make sure that your document includes a timestamp in ElasticSearch.
2) In the Query box, provide the Lucene query which narrows down the documents to only those related to this metric
3) In the Metric line, press "Count" and change that to one which takes a specific field: for example, "Average"
4) Next to the "Average" box will appear "select field", which is a dropdown of the available fields. If you see unexpected fieldnames here, it's probably because your Lucene query isn't specific enough. (Kibana can be useful for getting this query right)

Grafana connection with elasticsearch

I have successfully create a connection between Grafana and Elasticsearch. I have already indexed data into Elasticsearch , but Grafana doesn't want to show it as a "Singlestat".
Elasticsearch Data Picture
Grafana Settings Picture
So the value is "104". But why Grafana does not show this?
If you would like to show the current value in SigleStat panel you should do it in the following way:
In Elastic end - Save it as int, as in SigleStat panel you can show only integers fields.
In Grafana end - a. Add "ecommerce" index as data source (located in top left menu - data sources).
b. In SigleStat panel - "Metrics" tab - choose "ecommerce" data source.
c. In the query line: write the following "_type:supporttickets".
d. In Metric field - choose "Max" and "value" (if value is not int you will not see it in dropdown).
e. In SigleStat panel - "Options" tab - in "Stat" dropdown choose "current".
More options like colors by thresholds and stuff - http://docs.grafana.org/features/panels/singlestat/
Metric -> sum -> is looking for Numeric value but it is getting a string("104").
Insert the values of "#value" column as Integer in Elasticsearch

Visualizing a single string of text in Kibana

In Kibana, I have an index that looks like as follows
type (String)
value (String)
timestamp (Date)
I would like to have a visualization that shows the most recent value field where the type is equal to "battery", for example.
I would like the visualization to be similar to the "Metric" one, but displaying a string of text instead of a number, of course.
Is this possible with Kibana? If not, how can I get a similar result?
You can use a Data Table visualization.
In the search query you would specify type: "Battery"
In the metric section you would specify Max timestamp
In the Split Rows section you would specify Aggregation=Terms, Field=value, OrderBy=metric:Max timestamp, Order=descending, Size=1
You will have a result that is a table with 1 row and 2 columns, one of which being a value and the other a timestamp
If this does not satisfy your needs, you may look into available Kibana plugins that allow new visualizations (see the list of known plugins) or modify one of them to suite your needs.

Resources