kafka 传输数据到 logstash,经logstash 写入ES ,logstash 中 如何过滤json 反斜杠
Logstash | 作者 gjt | 发布于2019年11月15日 | 阅读数:2516
input {
kafka {
type => "gateOut_log"
bootstrap_servers => ["10.236.1.22:9092"]
topics => ["gateOut_log"]
#group_id => "filebeat-logstash"
#client_id => "logstashnode1"
consumer_threads => 1
codec => json
decorate_events => false
}
}
output{
if [type] == "gateOut_log" {
elasticsearch {
hosts => "10.236.1.22:9200"
index => "gateout-log"
}
}
"message" => "{\"xh\":\"0001\",\"cgmx\":\"Y\",\"rgmx\":\"Y\",\"tdh\":\"dsdikp_01\"}",
message json 格式 ,es 处理不了, 求教如何处理
kafka {
type => "gateOut_log"
bootstrap_servers => ["10.236.1.22:9092"]
topics => ["gateOut_log"]
#group_id => "filebeat-logstash"
#client_id => "logstashnode1"
consumer_threads => 1
codec => json
decorate_events => false
}
}
output{
if [type] == "gateOut_log" {
elasticsearch {
hosts => "10.236.1.22:9200"
index => "gateout-log"
}
}
"message" => "{\"xh\":\"0001\",\"cgmx\":\"Y\",\"rgmx\":\"Y\",\"tdh\":\"dsdikp_01\"}",
message json 格式 ,es 处理不了, 求教如何处理
1 个回复
zlzlsx
赞同来自:
json {
source => "message"
target => "message"
}
}