Sergey
Sergey

Reputation: 49728

Kibana displaying JSON incorrectly

I'm using ELK (Elasticsearch, Logstash, Kibana) for logging purposes. The problem is Kibana doesn't seem to recognize my JSON, because it puts my JSON inside message.

Here's how I run Logstash:

bin/logstash -e 'input { udp { port => 5000 type => json_logger } } output { stdout { } elasticsearch { host => localhost } }'

Here's an example Logstash output for my logs (for debugging purposes I also output logs to stdout):

2014-10-07T10:28:19.104+0000 127.0.0.1 {"user_id":1,"object_id":6,"@timestamp":"2014-10-07T13:28:19.101+03:00","@version":"1","severity":"INFO","host":"sergey-System"}

How do I make Elasticsearch/Kibana/Logstash recognize JSON?

Upvotes: 0

Views: 922

Answers (1)

Andrei Stefan
Andrei Stefan

Reputation: 52368

Try bin/logstash -e 'input { udp { port => 5000 type => json_logger codec => json} } output { stdout { } elasticsearch { host => localhost } }'.

Note the codec => json option.

Upvotes: 1

Related Questions