我试图用Kibana创建一个瓷砖地图。我的conf文件logstash正常工作,并生成Kibana绘制tile map所需的所有内容。这是我的conf logstash:
input {
file {
path => "/home/ec2-user/part.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["kilo_bytes_total","ip","session_number","request_number_total","duration_minutes_total","referer_list","filter_match_count_avg","request_number_avg","duration_minutes_avg","kilo_bytes_avg","segment_duration_avg","req_by_minute_avg","segment_mix_rank_avg","offset_avg_avg","offset_std_avg","extrem_interval_count_avg","pf0_avg","pf1_avg","pf2_avg","pf3_avg","pf4_avg","code_0_avg","code_1_avg","code_2_avg","code_3_avg","code_4_avg","code_5_avg","volume_classification_filter_avg","code_classification_filter_avg","profiles_classification_filter_avg","strange_classification_filter_avg"]
}
geoip {
source => "ip"
database => "/home/ec2-user/logstash-5.2.0/GeoLite2-City.mmdb"
target => "geoip"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
add_tag => "geoip"
}
mutate {
convert => [ "[geoip][coordinates]", "float"]
}
}
output {
elasticsearch {
index => "geotrafficip"
}
}
这就是产生的结果:
看起来很酷。试图创建我的瓷砖地图,我有这样的信息:
怎么办? 似乎我必须在某处添加使用dinamyc模板的可能性..我应该创建一个模板并将其添加到我的文件conf logstash中吗? 有人可以给我一些反馈意见吗? thx!
答案 0 :(得分:1)
如果您查看索引的Kibana设置,则至少需要一个字段才能显示geo_point
类型,以便能够在地图上获取任何内容。
如果您还没有geo_point
字段,则需要在为geoip.coordinates
字段设置适当的映射后重新索引数据。例如:https://stackoverflow.com/a/42004303/2785358
如果您使用的是相对较新版本的Elasticsearch(2.3或更高版本),则重新索引数据相对容易。您需要使用正确的映射创建新索引,使用重新索引API将数据复制到新索引,删除原始索引,然后重新索引回原始名称。
答案 1 :(得分:0)
您使用geoip
过滤器错误,并尝试将经度和纬度转换为浮动。摆脱mutate
过滤器并将geoip
过滤器更改为此。
geoip {
source => "ip"
fields => ["latitude","longitude"]
add_tag => "geoip"
}
这将创建适当的字段。以及所需的GeoJSON对象。