1. 一个 kibana 可以生成热力图的 logstash 配置 input {
file { path => ["/home/elk/logstash-6.3.2/test.log"] type => "system"
start_position => "end"
}
}
filter{
if [type] == "nginx"{ geoip { source => "message"
target => "geoip"
database => "/home/elk/logstash-6.3.2/GeoLite2-City_20181009/GeoLite2-City.mmdb"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ] add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
} mutate { convert => [ "[geoip][coordinates]", "float"]
}
}
}
output{
elasticsearch{
hosts => "http://127.0.0.1:9200"
user => "hi"
password => "ha"
}
stdout{
codec => rubydebug
}
}
2. vim 复制、粘贴 以下操作在 命令模式 操作; 先从复制说起,复制对象有:当前行、当前单词、若干行; yy 复制当前行; yw 复制当前单词(我刚试了下,数字也可以) nyy 复制 n 行,从当前行向下数 n 行; 粘贴就比较简单,一个 p 设定; Linux1. linux 查看文件最后 m 行 tail -n m filename
-n 是参数,嘿嘿。 2. linux 查看文件开关 m 行 head -n m filename
-n 是参数,跟上边一样。 3. linux 查看文件的 x 到 y 行 这里有两种方法: 方法一: cat filename | head -n y | tail -n +x
方法二: cat filename | tail -n +x | head -n y-x+1
比如我想显示一个文件的第 3 行到第 5 行,两种表达方式分别是: cat filename | head -n 5 | tail -n +3
cat filename | tail -n +3 | head -n 3
方法三: sed -n 'x,yp' filename
话说方法三简单直观呀。
|