我正在尝试让kibana-4地理地图与ELB日志一起工作
当我单击发现选项卡时,我可以清楚地看到字段geoip.location的值为经度,但当我单击可视化选项卡->切片地图->新搜索->地理坐标时,我得到一个错误(不显示错误是什么我也检查了kibana日志-但什么都没有)
我检查了检查元素-也没有
然后我选择了GeoHash,但字段是空的(当我单击它时,它是空白的,带有一个复选图标)
我如何才能看到错误是什么?怎样才能让这个地图正常工作呢?
我的配置是:
input {
file {
path => "/logstash_data/logs/elb/**/*"
exclude => "*.gz"
type => "elb"
start_position => "beginning"
sincedb_path => "log_sincedb"
}
}
filter {
if [type] == "elb" {
grok {
match => [
"message", '%{TIMESTAMP_ISO8601:timestamp} %{NGUSERNAME:loadbalancer} %{IP:client_ip}:%{POSINT:client_port} (%{IP:backend_ip}:%{POSINT:backend_port}|-) %{NUMBER:request_processing_time} %{NUMBER:backend_processing_time} %{NUMBER:response_processing_time} %{POSINT:elb_status_code} %{INT:backend_status_code} %{NUMBER:received_bytes} %{NUMBER:sent_bytes} \\?"%{WORD:method} https?://%{WORD:request_subdomain}.server.com:%{POSINT:request_port}%{URIPATH:request_path}(?:%{URIPARAM:query_string})? %{NOTSPACE}"'
]
}
date {
match => [ "timestamp", "ISO8601" ]
target => "@timestamp"
}
if [query_string] {
kv {
field_split => "&?"
source => "query_string"
prefix => "query_string_"
}
mutate {
remove => [ "query_string" ]
}
}
if [client_ip] {
geoip {
source => "client_ip"
add_tag => [ "geoip" ]
}
}
if [timestamp] {
ruby { code => "event['log_timestamp'] = event['@timestamp'].strftime('%Y-%m-%d')"}
}
}
}
}
output {
elasticsearch {
cluster => "ElasticSearch"
host => "elasticsearch.server.com"
port => 9300
protocol => "node"
manage_template => true
template => "/etc/logstash/lib/logstash/outputs/elasticsearch/elasticsearch-template.json"
index => "elb-%{log_timestamp}"
}
}发布于 2015-07-06 02:59:30
geo_ip索引在我的例子中不起作用,因为我的索引名称不是以logstash开头的-
如果希望自定义索引名称获取geo-ip,则必须为该索引名称创建模板
在elasticsearch的输出中使用它
elasticsearch {
manage_template => true
template => "/etc/logstash/templates/custom_template.json"
}您的模板应如下所示
{
"template" : "index_name-*",
"settings" : {
"index.refresh_interval" : "5s"
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true, "omit_norms" : true},
"dynamic_templates" : [ {
"message_field" : {
"match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "analyzed", "omit_norms" : true
}
}
}, {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "analyzed", "omit_norms" : true,
"fields" : {
"raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256}
}
}
}
} ],
"properties" : {
"@version": { "type": "string", "index": "not_analyzed" },
"geoip" : {
"type" : "object",
"dynamic": true,
"properties" : {
"location" : { "type" : "geo_point" }
}
}
}
}
}
}发布于 2015-03-30 20:13:47
在我们的地图上,我们指定了一个字段geoip.location,根据文档,它是由geoip过滤器自动创建的。
您能在discover中看到该字段吗?如果没有,您是否可以尝试修改您的geoip过滤器以
if [client_ip] {
geoip {
source => "client_ip"
add_tag => [ "geoip" ]
target => "geoip"
}
}看看您现在是否可以在新条目中看到geoip.location?
elasticsearch模板在创建相关的geoip字段时查找"geoip“目标。
一旦我们创建了geoip.location,我们就可以通过Kibana4中的以下步骤创建一个新的地图。
Tile Map‘geo coordinates’存储桶类型-此时您将看到一个错误标记,在‘D13’下拉列表中,选择'geohash'geoip.location'https://stackoverflow.com/questions/29344547
复制相似问题