elastic / elastic/logstash

Cannot connect logstash's output to an input

Open
#4,257 0 comments 0 reactions 0 assignees View on GitHub
unconfirmed
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

Hi,

I have a configuration here that isn't working.

Create an empty `mylog.log` file, modify configuration, then have `while [ 1 ]; do nc -l -p 5500; done` running to see if Logstash is correctly sending our events to TCP/5500.

But, it seems we cannot connect logstash to itself.

I need that to to some extra computing for a given output. My use case is the following: `json input -> adding fields -> output an email, using some fields -> output to another input of logstash -> cleanup fields -> output AMQP`

Here is the minimal configuration used to show the problem:

```
input {
file {
path => "/home/wrk/Downloads/logstash-2.0.0/mylog.log"
tags => ["input_a"]
}
tcp {
port => 5401
codec => "json"
tags => ["input_b"]
}
}

filter {
if "input_b" in [tags] {
mutate {
remove_tag => ["input_a"]
add_field => {"bla" => "blip"}
}
}
}

output {
stdout {
codec => "json"
}
if "input_a" in [tags] {
tcp {
port => 5401
host => "localhost"
codec => "json"
}
}
else if "input_b" in [tags] {
tcp {
port => 5500
host => "localhost"
codec => "json"
}
}
}
```

All i get on `stdout` is:

``` json
{"message":"bla","@version":"1","@timestamp":"2015-11-24T14:07:43.243Z","host":"amidala","path":"/home/wrk/Downloads/logstash-2.0.0/mylog.log","tags":["input_a"]}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.