# Logstash syslog output message =\> %{\_source}

**URL:** <https://discuss.elastic.co/t/logstash-syslog-output-message-source/175028>\
**Category:** Logstash\
**Created:** [April 2, 2019, 3:51pm UTC](https://discuss.elastic.co/t/logstash-syslog-output-message-source/175028 "2019-04-02T15:51:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![souf\_el\_badraoui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souf_el_badraoui/32/47746_2.png) [@souf\_el\_badraoui](https://discuss.elastic.co/u/souf_el_badraoui)\
**Post date:** [April 2, 2019, 3:51pm UTC](https://discuss.elastic.co/t/logstash-syslog-output-message-source/175028/1 "2019-04-02T15:51:06Z")

</div>

Hello,  
We are trying to forward windows event log shipped with winlogbeat via logstash output syslog. The problem is that we want to forward all fields (ideally key1=value1 key2=value2...) and not just the message field. We can't construct a new field concatenating all the others because we don't know which field will be available depending on the windows event log. Is it possible to use the \_source field like :

> ```
> Output {
> syslog{
> message => "%{_source}"
> }
> }
> 
> ```

because this field is exactly what we want to forward via syslog.  
Thank you for your help !!

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 2, 2019, 5:47pm UTC](https://discuss.elastic.co/t/logstash-syslog-output-message-source/175028/2 "2019-04-02T17:47:40Z")

</div>

> [@souf\_el\_badraoui](#):
>
> We can't construct a new field concatenating all the others because we don't know which field will be available depending on the windows event log.

Actually you can do exactly that using a ruby filter

```
    ruby {
        init => '@ignore = ["@metadata", "@version"]'
        code => '
            s = ""
            event.to_hash.each { |k, v|
                unless @ignore.include?(k)
                    s = s + "#{k}=#{v},"
                end
                event.set("message", s.chomp(","))
            }
        '
    }

```

---

<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:** [April 30, 2019, 5:47pm UTC](https://discuss.elastic.co/t/logstash-syslog-output-message-source/175028/3 "2019-04-30T17:47:45Z")

</div>

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