Group by Terms my_field.keyword

I can’t see field.keyword when I try to build Grafana chart with elasticsearch data source.
when I try to use Group by Terms field
Grafana says

Fielddata is disabled on text fields by default. Set fielddata=true on [user_name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.

https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html
any one have idea how to use keyword with Group by and Terms if
I enter user_name.keyword like below I can’t see data on chart

On Kibana I can see “user_name.keyword” when I Group by and Terms,

Common problem when upgrading to Elasticsearch 5.x. Answered here:

So check your mapping to see if you have a keyword index mapping that you can use otherwise you will have to create it.

Hi ,

I’m using Elasticsearch 5.4 and Logstash 5.4 I can see user_name.keyword not analyzed in Index Patterns.

My question is
I can see it in Kibana but, I can’t see it Grafana.

Kibana

Grafana

After I enter user_name.keyword manualy
I can see data on my Graph

Thank you for support

1 Like

Hi @warunacs / @daniellee ,

Requirement

Get the Top hitting IPs and their count and visualize in Grafana

We are trying to populate the distinct IP (dynamic values) and their count in Grafana (version 7.5.11).

We were able to populate the logs from ES into Grafana, however unable to achieve the requirement (mentioned earlier).

Data Source :: Elastic Search (version 7.8.0)

Getting the following ERROR when I try to get the unique count of each IP keeping a threshold of 300 and ,
Grouping them based on each IP.

Result when tried with “ap_client_ip.keyword”

Could you please advise ?