作者:清晨竹林9_877 | 来源:互联网 | 2023-05-29 17:32
bin目录下
1: ./logstash -e "input {stdin {}} output {stdout{}}"
主要是输入和过滤 及 输出流程
例子2:
./bin/logstash -e "input {stdin {}} output {stdout{codec => plain}}"
2:通过定义conf文件来执行:
input { stdin { } }
filter {
grok {
match => {
"message" => "%{WORD:request}\?client=%{WORD:client}&areaCode=%{NUMBER:area}&netWorkId=%{NUMBER:net}"
}
remove_field => ["message"]
}
}
output { stdout {} }
1:一个是删除lock,一个是删除上次的偏移量
操作之前 ,删除.lock
std_es.conf 如下:
input {
stdin { }
}
output {
elasticsearch {
hosts => ["http://121.40.42.216:9200"]
index => "mystdin"
user => "elastic"
password => "elasticCll" }
}
注:会自动创建索引