# Netflow input and output

**URL:** <https://discuss.elastic.co/t/netflow-input-and-output/289974>\
**Category:** Logstash\
**Created:** [November 23, 2021, 5:52pm UTC](https://discuss.elastic.co/t/netflow-input-and-output/289974 "2021-11-23T17:52:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![btjtaylor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/btjtaylor/32/97459_2.png) [@btjtaylor](https://discuss.elastic.co/u/btjtaylor)\
**Post date:** [November 23, 2021, 5:52pm UTC](https://discuss.elastic.co/t/netflow-input-and-output/289974/1 "2021-11-23T17:52:54Z")

</div>

Hi all

I need to receive netflow data and output it to multiple destinations (just testing with single destination for now)

Im running logstash 7.15.2 under windows

I made the following logstash config file but it crashes when netflow data is received:

```auto
input {
  udp {
    port => 2055
    codec => netflow
  }
}

output {
  
udp {
    port => 2055
    codec => netflow
    host => "10.2.0.6"
  }

file {
     path => "c:\netflow\netflow.txt"
  }
}

```

If I remove the UDP output (leave the file output in) it works fine, I can see netflow data output to a txt file.

Does anyone have any ideas about what is wrong with my netflow output? I cant find any exampls online

Thanks in advance

---

<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:** [November 23, 2021, 6:22pm UTC](https://discuss.elastic.co/t/netflow-input-and-output/289974/2 "2021-11-23T18:22:15Z")

</div>

> [@btjtaylor](#):
>
> Does anyone have any ideas about what is wrong with my netflow output?

The [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-netflow.html#_description_184) says the codec is used to _decode_ netflow packets. The code does not have an encode method, so I am not surprised that an exception occurs. I am surprised at what that exception is 😃 (A stack overflow!)

There is an open [issue](https://github.com/logstash-plugins/logstash-codec-netflow/issues/185) requesting support for use of the codec on an output.

In short, you cannot use the codec on an output.

---

<div class="post-metadata">

**Author:** ![rcowart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rcowart/32/88091_2.png) [@rcowart](https://discuss.elastic.co/u/rcowart)\
**Post date:** [November 26, 2021, 9:29am UTC](https://discuss.elastic.co/t/netflow-input-and-output/289974/3 "2021-11-26T09:29:03Z")

</div>

Just use samplicator to send the UDP packets to multiple destinations.

> **[GitHub - sleinen/samplicator: Send copies of (UDP) datagrams to multiple...](https://github.com/sleinen/samplicator)**
>
> Send copies of (UDP) datagrams to multiple receivers, with optional sampling and spoofing - GitHub - sleinen/samplicator: Send copies of (UDP) datagrams to multiple receivers, with optional samplin...

If it is useful, the ElastiFlow team makes a samplicator docker container available here.

[https://hub.docker.com/r/elastiflow/samplicator](https://hub.docker.com/r/elastiflow/samplicator)

---

<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:** [December 24, 2021, 9:30am UTC](https://discuss.elastic.co/t/netflow-input-and-output/289974/4 "2021-12-24T09:30:00Z")

</div>

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