我的目标是,每当我的webhook收到POST请求时,我希望将json有效负载发送到ElasticSearch索引。
为此,我使用了带有HTTP插件的Logstash管道。当我使用来自本地配置在端口9000上的webhook的输入时,我可以在本地配置webhook时发送webhook消息
input {
http {
host => "0.0.0.0"
port => "9000"
codec => "json"
}
}
filter {
mutate {
add_field => {
"documentType" => "productionlogs"
"deleted" => "false"
"created" => "%{@timestamp}"
"modified" => "%{@timestamp}"
}
}
}
output {
elasticsearch {
hosts => [ '${ES_HOST_ADDRESS}' ]
user => '${ES_USER}'
password => '${ES_PASSWORD}'
ssl => "true"
index => "production_logs"
}
stdout {
id => "Pipeline_logs"
codec => "json"
}
}
但是当我使用来自“www.example.com“的外部webhook端点时https://requestinspector.com/,
第一次
需要帮忙吗?谢谢
1条答案
按热度按时间9jyewag01#
您只需要在第5行写入
==>
而不是=>
;- )应道:
以
Expected one of ...
开头的错误通常是打字错误/缺少括号/等。