# Logstash output to self, can't receive anything?

**URL:** <https://discuss.elastic.co/t/logstash-output-to-self-cant-receive-anything/67639>\
**Category:** Logstash\
**Created:** [November 30, 2016, 3:16pm UTC](https://discuss.elastic.co/t/logstash-output-to-self-cant-receive-anything/67639 "2016-11-30T15:16:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skluoyifan](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@skluoyifan](https://discuss.elastic.co/u/skluoyifan)\
**Post date:** [November 30, 2016, 3:16pm UTC](https://discuss.elastic.co/t/logstash-output-to-self-cant-receive-anything/67639/1 "2016-11-30T15:16:31Z")

</div>

config like this:

```ruby
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 ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 5, 2016, 6:35am UTC](https://discuss.elastic.co/t/logstash-output-to-self-cant-receive-anything/67639/2 "2016-12-05T06:35:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 2, 2017, 6:35am UTC](https://discuss.elastic.co/t/logstash-output-to-self-cant-receive-anything/67639/3 "2017-01-02T06:35:28Z")

</div>

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