Http output plugin json output issue

I need to get output from the Logstash http output plugin in json format. I have configured input from the apache logs. Here's the configuration.

input {
    file {
        path => '/var/log/apache2/access.log'
    }
}

filter {
    grok {
        match => { "message" => "%{COMBINEDAPACHELOG}" }
    }
}

output {
        http {
		format=>"json"
		content_type =>"application/json"
                http_method=>"post"
                url=>"http://localhost:8081"
        }
        elasticsearch {
                hosts => ["localhost:9200"]
                index => "apache_logs"
        }
        stdout { codec => rubydebug }
}

I have a nodejs script running on port 8081 to receive the output. I tried:

curl -XPOST http://localhost:8081

How do I get the entire logs via curl request ?

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