I try to upload log file in elasticsearch using logstash
i use this curl command
system@system-VirtualBox:~/Downloads/logstash-6.5.4$ curl -s -XPOST localhost:9200/_bulk --data @/home/system/Documents/LOG Data File/app2.log
But it seen this error
{"error":{"root_cause":[{"type":"parse_exception","reason":"request body is required"}],"type":"parse_exception","reason":"request body is required"},"status":400}
Thah was not necessarily very helpful, sorry... Try this (I don't really use file inputs so it might not be 100% correct). Put the below in a file e.g. logstash.conf
{"error":{"root_cause":[{"type":"parse_exception","reason":"request body is required"}],"type":"parse_exception","reason":"request body is required"},"status":400}
At least in the subject you say you want to use Logstash.
If you take my suggested Logstash configuration from above and start Logstash with
logstash-6.5.4/bin/logstash -f logstash.conf
That is all that is needed. You do not need to manually run curl commands after that. Logstash will read the log file and send the data to Elasticsearch.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.