input {
rabbitmq {
host => "192.168.x.x" #RabbitMQ-IP地址
vhost => "/" #虚拟主机
port => 5672 #端口号
arguments =>{"x-max-priority" => 10}
arguments =>{"x-queue-mode" =>"lazy"}
user => "admin" #用户名
password => "admin" #密码
queue => "log.detail" #队列
durable => true #持久化跟队列配置一致
codec => "json" #格式
ack => true
}
}
output {
elasticsearch {
hosts => ["192.168.x.x:9200"]
index => "logstash-rabbitmq"
}
}
input 配置注意的点 rabbitmq的arguments 多个参数要写多行,写一行会报错。