Grafana分析Nginx日志

配置Groub by -Terms时报错,提示需要设置fielddata=true,报错内容大概如下: 

"Fielddata is disabled on text fields by default ... "

解决方法如下:

https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#_fielddata_is_disabled_on_literal_text_literal_fields_by_default

curl -X PUT "localhost:9200/nginx/_mapping/doc" -H 'Content-Type: application/json' -d'
{
  "properties": {
    "xforward": { 
      "type":     "text",
      "fielddata": true
    }
  }
}
'

操作后仍然报错,于是

curl -X PUT "localhost:9200/nginx/_mapping/doc?update_all_types" -H 'Content-Type: application/json' -d'         
{
  "properties": {
    "xforward": { 
      "type":     "text",
      "fielddata": true
    }
  }
}
'

以上nginx为index名称  xforward为字段名称

修改成功后,可以正常出图。

猜你喜欢

转载自www.cnblogs.com/wjoyxt/p/9231063.html