"_jsonparsefailure" Getting Error while reading messages from RabbitMQ

I am reading messages from rabbitmq while running the config file getting error "jsonparsefailure".
message like "You have withdrawn RS. xxxfrom ATM.", "You are welcome again", etc...
My config file:
input {
rabbitmq {
host => "localhost"
port => 5672
user => "guest"
password => "guest"
durable => true
queue => "test-queue"
}
}
filter{
json{
source => "message"
}
}
output {
# elasticsearch {
# hosts => "localhost:9200"
# }
stdout {
codec => rubydebug
}
}

That is not valid JSON, so a _jsonparsefailure tag would be expected. What is your question?

Yes, I know this is not JSON. The first time I run without JSON in the filter then I got an error _jsonparsefailure then I put JSON plugin inside the filter. I need how to solve this problem.

input {
rabbitmq {
host => "localhost"
port => 5672
user => "guest"
password => "guest"
durable => true
queue => "test-queue"
}
}

output {
elasticsearch {
hosts => "localhost:9200"
}
stdout {
codec => rubydebug
}
}
still getting _jsonparsefailure error.

The default codec for a rabbitmq is json. So you will need to specify a codec on the input. plain or line, perhaps, it really depends on your data format.

"You have withdrawn RS. xxx from ATM.",
"You are welcome again"
I have such type of messages in rabbitmq I need to read in logstash. But getting JSON error. So How I can resolve this issue?

You will need to specify a codec on the input. plain or line, perhaps, it really depends on your data format. line should work if the messages have a trailing newline, plain if they do not.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.