【发布时间】:2016-11-19 23:36:09
【问题描述】:
我正在使用 ELK 堆栈来运送日志。
我正在处理的问题是其中一个字段分解为多个值。
明确地说,对于现场产品,我的值应该是:Anti Malware、New Anti Virus、VPN-1 & FireWall-1 等等。
但是,运行时:
curl --user admin:111111 -XPOST 'localhost:9200/filebeat-2016.07.14/_search?pretty' -d '
{
"size": 0,
"aggs": {
"group_by_product": {
"terms": {
"field": "product",
"script": "_value"
}
}
}
}'
输出是:
{
"size": 0,
"aggs": {
"group_by_product": {
"terms": {
"field": "product"
}
}
}
}'
{
"took" : 116,
"timed_out" : false,
"_shards" : {
"total" : 20,
"successful" : 20,
"failed" : 0
},
"hits" : {
"total" : 2624573,
"max_score" : 0.0,
"hits" : [ ]
},
"aggregations" : {
"group_by_product" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 8748,
"buckets" : [ {
"key" : "1",
"doc_count" : 2439769
}, {
"key" : "firewall",
"doc_count" : 2439769
}, {
"key" : "vpn",
"doc_count" : 2439769
}, {
"key" : "anti",
"doc_count" : 166522
}, {
"key" : "malware",
"doc_count" : 87399
}, {
"key" : "new",
"doc_count" : 79123
}, {
"key" : "virus",
"doc_count" : 79123
}, {
"key" : "blade",
"doc_count" : 8249
}, {
"key" : "compliance",
"doc_count" : 8249
}, {
"key" : "identity",
"doc_count" : 5176
} ]
}
}
}
所以VPN-1 & FireWall-1 的值分为vpn、firewall 和1。
我看到它与已分析字段有关,但我无法将字段定义为未分析,因为字段创建是动态的。
谢谢。
【问题讨论】:
标签: ruby elasticsearch logstash kibana elastic-stack