# Help needed with Logstash and syslog config

**URL:** <https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548>\
**Category:** Logstash\
**Created:** [June 12, 2015, 8:36am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548 "2015-06-12T08:36:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![janus](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@janus](https://discuss.elastic.co/u/janus)\
**Post date:** [June 12, 2015, 8:36am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548/1 "2015-06-12T08:36:31Z")

</div>

Hello all,

First of all I have to say that I am new to ELK, in fact I have just installed it in the system.

Let me go to the point. 😃

I have followed the oceand digital manual to install elk in a brand new debian system ([https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-4-on-ubuntu-14-04](https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-4-on-ubuntu-14-04)) with a few modifications (basically using the latest versions and without ssl support)

Once configured, I have done three tests using this config files:  
[https://www.elastic.co/guide/en/logstash/master/config-examples.html](https://www.elastic.co/guide/en/logstash/master/config-examples.html)

The first two tests run perfectly but when I get to the syslog one, no way.

This is my config file:

```

input {
  udp {
    port => 5000
    type => syslog
  }
}

filter {
  if [type] == "syslog" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
      add_field => ["received_at", "%{@timestamp}"]
      add_field => ["received_from", "%{host}"]
    }
    syslog_pri { }
    date {
      match => ["syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]
    }
  }
}

```

And this is a snaptshot of the syslog data transfer

 ![](https://us1.discourse-cdn.com/elastic/original/1X/2634b2ac2b3a6e45de4164f0bd19684de25f42a2.png)

As it can be seen, logstash runs fine, no warnings,the system starts listening on port 5000(udp) but when i connect to the system using nc and sending the data, the data arrives but logstash does nothing

I have been looking in the logsthash logs but found nothing.

Any help will be appreciated.

Thanks a lot for your time,

---

<div class="post-metadata">

**Author:** ![yuphing](https://avatars.discourse-cdn.com/v4/letter/y/7ea924/32.png) [@yuphing](https://discuss.elastic.co/u/yuphing)\
**Post date:** [June 12, 2015, 9:04am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548/2 "2015-06-12T09:04:06Z")

</div>

my match for pfsense syslogs looks like this (note the square brackets):

```
match => ["message", "%{SYSLOGTIMESTAMP:syslog_timestamp}: %{WORD:syslog_severity} %{SYSLOGHOST:syslog_hostname} %{SYSLOGPROG:syslog_program}:%{SPACE} %{GREEDYDATA:syslog_message}"]
```

---

<div class="post-metadata">

**Author:** ![janus](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@janus](https://discuss.elastic.co/u/janus)\
**Post date:** [June 12, 2015, 9:31am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548/3 "2015-06-12T09:31:59Z")

</div>

Thanks for the update yuphing.

I have done the change but it does not work.

I have loaded the modified config file, logstash runs fine, at least it does not give any erri, I send the info, the system gets it but logstash does nothing.

---

<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:** [June 12, 2015, 10:07am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548/4 "2015-06-12T10:07:41Z")

</div>

You have a udp input and a couple of filters, but where are your outputs? For debugging this is a common recommendation:

```
output {
  stdout {
    codec => rubydebug
  }
}
```

---

<div class="post-metadata">

**Author:** ![yuphing](https://avatars.discourse-cdn.com/v4/letter/y/7ea924/32.png) [@yuphing](https://discuss.elastic.co/u/yuphing)\
**Post date:** [June 12, 2015, 10:17am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548/5 "2015-06-12T10:17:20Z")

</div>

magnusbaeck is right, I usually have something like this too for output:

```
output {
        if !("_grokparsefailure" in [tags]) {
                elasticsearch {
                        host => "localhost"
                        cluster => "elasticsearch_cluster"
                        index => "logstash-%{type}-%{+YYYY.MM.dd}"
                }
        } else {
                file {
                        path => "/var/log/logstash/debug-%{type}.out"
                }
        }
}
```

---

<div class="post-metadata">

**Author:** ![janus](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@janus](https://discuss.elastic.co/u/janus)\
**Post date:** [June 12, 2015, 10:32am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548/6 "2015-06-12T10:32:28Z")

</div>

Yeap, you are totally right, no ouptut. Have to say it, Im idiot xD, dont know how to copy and paste.

Thanks a lot guys, problem solved

Sorry for the inconvenience

---

<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:** [July 6, 2017, 5:37am UTC](https://discuss.elastic.co/t/help-needed-with-logstash-and-syslog-config/2548/7 "2017-07-06T05:37:36Z")

</div>


