# Logstash to output syslog in Snare format

**URL:** <https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405>\
**Category:** Logstash\
**Created:** [April 27, 2021, 3:26pm UTC](https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405 "2021-04-27T15:26:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravi342883](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi342883/32/74643_2.png) [@Ravi342883](https://discuss.elastic.co/u/Ravi342883)\
**Post date:** [April 27, 2021, 3:26pm UTC](https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405/1 "2021-04-27T15:26:02Z")

</div>

Hi All,

For a PoC portion, I would like to know whether logstash can output the syslogs in Snare format. Any reference?

If anyone has got insights around this, please shed some light here.

Thanks,  
Ravi

---

<div class="post-metadata">

**Author:** ![Husnain](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@Husnain](https://discuss.elastic.co/u/Husnain)\
**Post date:** [April 27, 2021, 3:44pm UTC](https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405/2 "2021-04-27T15:44:20Z")

</div>

Hii @Ravi342883.You can refer this link.This might help you.

> <https://github.com/philhagen/sof-elk/blob/main/configfiles/6010-snare.conf>

---

<div class="post-metadata">

**Author:** ![Ravi342883](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi342883/32/74643_2.png) [@Ravi342883](https://discuss.elastic.co/u/Ravi342883)\
**Post date:** [April 27, 2021, 4:01pm UTC](https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405/3 "2021-04-27T16:01:41Z")

</div>

Thanks you @Husnain ..  
I think this config file talks about consuming (input) snare format logs, But, I'm looking for other way around (to output snare format).

Syslog -\> Snare

---

<div class="post-metadata">

**Author:** ![Husnain](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@Husnain](https://discuss.elastic.co/u/Husnain)\
**Post date:** [May 11, 2021, 4:39am UTC](https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405/4 "2021-05-11T04:39:11Z")

</div>

Hii @Ravi342883.Np at all.I hope you will get the solution for this.

---

<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:** [May 11, 2021, 5:10pm UTC](https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405/5 "2021-05-11T17:10:58Z")

</div>

From what I can see, snare is just a set of fields that are tab separated. I think you could do that using a line codec with a format option

```
output { file { codec => line { format => "%{1stField} %{2ndField}..." ...} ... } }

```

where the separator in the format option is a tab character.

---

<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:** [June 8, 2021, 5:11pm UTC](https://discuss.elastic.co/t/logstash-to-output-syslog-in-snare-format/271405/6 "2021-06-08T17:11:30Z")

</div>

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