Monitor TomCat Logs

I am trying to Monitor our Tomcat logs with Elastic Search / LogStash

when i try and create a mapping:

curl -XPUT "http://:9200/logs/" -d '{ "mappings" : { "tomcat_access":{ "discover":".*"}}}'

I am getting the following Error:

{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}root@ip-10-239-48-161:/etc/logstash/conf.d#

That is default content type for a curl PUT. You should use:

curl -X PUT "localhost:9200/[...]" -H 'Content-Type: application/json' -d'[...]'

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