我刚打酱油去了,不好意思

kibana如何才能使用nested的字段作为可视化的条件?

Kibana | 作者 xiajichenxi | 发布于2021年07月02日 | 阅读数:3016

es和kibana版本:
5.4.1
数据索引结构:
 "mappings": {
"appinfo": {
"_parent": {
"type": "ipinfo"
},
"_routing": {
"required": true
},
"properties": {
"app_info": {
"type": "nested",
"properties": {
"apk_md5": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"apk_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"apk_size": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"app_type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"first_time": {
"type": "date"
},
"label_info": {
"properties": {
"label_1": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"label_2": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"label_3": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"label_4": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"last_time": {
"type": "date"
},
"new_keyhash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"permeation_level": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"program_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"version_code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"vir_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
}
}
},
"objectid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"ipinfo": {
"properties": {
"android_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"city_info": {
"type": "nested",
"properties": {
"isp": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"latitude": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"longitude": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"lonlat": {
"type": "geo_point"
},
"permanent_city": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"permanent_country": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"permanent_province": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"time": {
"type": "date"
},
"user_ip": {
"type": "ip"
}
}
},
"date": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"device": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"district": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"imei_p": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"lonlattest": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"oaid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"objectid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"permanent_city": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"permanent_country": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"permanent_province": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"phone_brand": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"query": {
"properties": {
"term": {
"properties": {
"objectid": {
"properties": {
"keyword": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
},
"terms": {
"properties": {
"objectid": {
"properties": {
"keyword": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}
},
"script": {
"properties": {
"inline": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"lang": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"params": {
"properties": {
"lat": {
"type": "long"
},
"lon": {
"type": "long"
},
"test123": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"source": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"serial_number_p": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"system": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"system_build": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"system_version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"user_ip": {
"type": "ip"
},
"uuid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"type": {
"properties": {
"foo": {
"type": "keyword",
"eager_global_ordinals": true
}
}
},
"wifiinfo": {
"_parent": {
"type": "ipinfo"
},
"_routing": {
"required": true
},
"properties": {
"objectid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"wifi_info": {
"type": "nested",
"properties": {
"address": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"bssid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "only_words_analyzer"
},
"cnt": {
"type": "long"
},
"lat": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"lon": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"lonlat": {
"type": "geo_point"
},
"ssid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"time": {
"type": "date"
},
"user_ip": {
"type": "ip"
}
}
}
}
}
}
数据样例:
wifi_info: [
{
"user_ip": "223.9.125.200",
"address": "山西省大同市城区新建南路街道建设里38号楼;云中路与迎泽街路口东北150米",
"bssid": "c4:a3:66:8d:32:38",
"cnt": 22,
"lon": "113.276764",
"time": "20210531",
"ssid": "ChinaNet-XHzg",
"lat": "40.088661",
"lonlat": "40.088661,113.276764"
},
{
"user_ip": "121.30.164.25",
"address": "山西省大同市南郊区水泊寺乡曹夫翰林苑b区9号楼;兴云街与文兴路路口北454米",
"bssid": "68:db:54:45:11:20",
"cnt": 3,
"lon": "113.338493",
"time": "20210506",
"ssid": "@PHICOMM_1F",
"lat": "40.096249",
"lonlat": "40.096249,113.338493"
}]
这样可以看到,在嵌套中由lonlat这个类型为geopoint的字段,然后在kibana中选择地理图,选这个字段作为buckets,则没有任何显示,但是如果做一个测试索引,将lonlat这个字段提取到nested外面,不放在嵌套里面,则可以正常显示。。
 
想问的问题:、
1、我这个判断准确吗?是因为嵌套文档的关系导致kibana无法使用geopoint的地理图吗?
2、如果是的话,目前kibana是否支持嵌套文档?什么版本支持?这个支持的版本是否和5.4.1的elasticsearch兼容?
 
感谢各位。
 
已邀请:

liuxg - Elastic

赞同来自:

目前对于 nested 的数据类型,Kibana 还不支持

要回复问题请先登录注册