Logstash output to self, can't receive anything?


(luoyifan) #1

config like this:

input {
	file {
	    path => "D:/Projects/jzt2/bd/erpxs/logstash/example.json"
	    codec => json { charset => "UTF-8" }
	    start_position => beginning
	    sincedb_path => "./sincedb.txt"
	    type => "log"
	}
	tcp {
		type => "head"
		port => 5040
		codec => json { charset => "UTF-8" }
	}
}

filter {
  if [type] == 'log' {
    date {
	  match => ["Timestamp", "ISO8601"]
	  target => "@timestamp"
	}
	mutate {
	  remove_field => [ "path", "@version", "host", "Timestamp" ]
	}
  }
}

output {
  if [type] == 'log' {
    tcp {
      host => 'localhost'
      port => 5040
      mode => 'client'
      codec => json { charset => "UTF-8" }
    }
  } else if [type] == 'head' {
  	  stdout { codec => rubydebug }
  }
}

why can't receive anything from localhost:5040 ?


(Magnus B├Ąck) #2

What do you mean? Are you trying to send data to port 5040 and nothing comes through? What happens then?


(system) #3

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