Logstash input http plugin response back


(Arslan Khan) #1

Hi all,
I am working on logstash to use input http plugin to receive data. I am using CURL command to send data to it and every time it respond in 'ok' but there are errors in parsing data in logstash.

My question is that is it possible to send logstash stdout as a response to CURL command?.


(Mark Walkom) #2

What's your config look like>?


(Arslan Khan) #3

Hi Mark,

Below is my config file. The issue is whenever an input http receive a data it sends ACK abruptly but i want it send my stdout.

input {
  http{

    host => "127.0.0.1"
    port => 9090
    codec => "json"
}
}

filter {

 if [node_id] == "" {
     drop{}
 } else if [user_id] == "" {
  drop{}
 } else {

 mutate {
     add_field => { "request" => "%{headers[request_path]}"}
     add_field=>{"timeuid"=>"%{timestamp}"}
     remove_field => ["headers","@version","host"]

  }
}
}

output{
   stdout {
            codec => "json"
    }
  if [request] =="/v1/post/node"
{
     cassandra{
     hosts=>["127.0.0.1"]
     port => 9042
     protocol_version => 4
     keyspace => "test"
     table => "node"
     username => "cassandra"
     password => "cassandra"
     hints => {
            id => "int"
            at => "timestamp"
            resellerId => "int"
            errno => "int"
            duration => "float"
            ip => "inet"}
    ignore_bad_values => true
    retry_policy => { "type" => "default" }
    flush_size => 500
    idle_flush_time => 1
}
}

(Magnus B├Ąck) #4

My question is that is it possible to send logstash stdout as a response to CURL command?.

No.


(Arslan Khan) #5

Thanks


(system) #6

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