# \[Logstash 7.2\] Syslog Output message

**URL:** <https://discuss.elastic.co/t/logstash-7-2-syslog-output-message/193483>\
**Category:** Logstash\
**Created:** [August 2, 2019, 8:43am UTC](https://discuss.elastic.co/t/logstash-7-2-syslog-output-message/193483 "2019-08-02T08:43:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stestaz](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@stestaz](https://discuss.elastic.co/u/stestaz)\
**Post date:** [August 2, 2019, 8:43am UTC](https://discuss.elastic.co/t/logstash-7-2-syslog-output-message/193483/1 "2019-08-02T08:43:28Z")

</div>

Hi All,  
syslog output is making me crazy.  
I have a logstash input with multiple line concatenation, the concatenated message has the field "message" containing only the last line and the field "conn\_mess" containing the complete message.  
I'm trying to send through Syslog Output Plugin "conn\_mess" to a syslog server but only the field "message" arrives to the syslog server

This is my output configuration

> elasticsearch {  
> index =\> "exchange-smtpreceive-%{+YYYY.MM.dd}"  
> hosts =\> ["192.168.7.224:9200"]  
> }  
> syslog{  
> host =\> "192.168.7.25"  
> port =\> "514"  
> message =\> "%{[conn\_mess]}"  
> msgid =\> "%{[sessionID]}"  
> appname =\> "SMTPRECEIVE-LOGSTASH"  
> sourcehost =\> "192.168.7.231"  
> }

And this is my last statement on the input aggregation

> if [event] == "-" {  
> aggregate {  
> task\_id =\> "%{sessionID}"  
> code =\> "event.set('conn\_user',map['conn\_user'])  
> event.set('conn\_mess', map['conn\_mess'])"  
> push\_previous\_map\_as\_event =\> true  
> end\_of\_task =\> true  
> timeout =\> 120  
> add\_tag =\> ['fine']  
> }

I've tried many different output configuration but I cannot find the right one, of course the elasticsearch output is fine.

thx!

---

<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:** [August 2, 2019, 1:46pm UTC](https://discuss.elastic.co/t/logstash-7-2-syslog-output-message/193483/2 "2019-08-02T13:46:08Z")

</div>

Looking through the code, message is used to [set](https://github.com/logstash-plugins/logstash-output-syslog/blob/a73f7bf598db921952e3853577b84e639c3e443d/lib/logstash/outputs/syslog.rb#L135) the format option on the output codec. The codec [sprintfs](https://github.com/logstash-plugins/logstash-codec-plain/blob/ffbde3c73601d887268c727523774c054b58ee48/lib/logstash/codecs/plain.rb#L39) the format and calls the publish method of the output. The publish then [joins](https://github.com/logstash-plugins/logstash-output-syslog/blob/a73f7bf598db921952e3853577b84e639c3e443d/lib/logstash/outputs/syslog.rb#L155) that up with the other parts of the message.

Instead of specifying the message option on the syslog output, specify the codec

```
 codec => plain { format => "%{[conn_mess]}" }

```

If that works then there is something wrong with that first piece of code I linked to.

---

<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:** [August 30, 2019, 1:46pm UTC](https://discuss.elastic.co/t/logstash-7-2-syslog-output-message/193483/3 "2019-08-30T13:46:09Z")

</div>

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