大家好,请问logstash读取日志文件后经过if判断,把符合条件的日志发送给钉钉,但是给钉钉发送消息的字段不知道应该怎么配置,贴出来我的配置
input {
file {
path => "/data/nfs-volume/logs/app-api/app-api-6b9bc888b7-bbscb.monitor.20210324.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
###################input_end###############################
output{
if '"level":"error"' in [message] {
# stdout {
# codec => json
# }
http {
url => "钉钉url"
http_method => "post"
content_type => "application/json; charset=utf-8"
format => "message"
message => '{"msgtype":"text","text":{"content":"这个地方不知道怎么写"}}'
}
}
}
input {
file {
path => "/data/nfs-volume/logs/app-api/app-api-6b9bc888b7-bbscb.monitor.20210324.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
###################input_end###############################
output{
if '"level":"error"' in [message] {
# stdout {
# codec => json
# }
http {
url => "钉钉url"
http_method => "post"
content_type => "application/json; charset=utf-8"
format => "message"
message => '{"msgtype":"text","text":{"content":"这个地方不知道怎么写"}}'
}
}
}
0 个回复