Chinese Yellow Pages | Classifieds | Knowledge | Tax | IME

While searching a command line to write something into a UNIX Domain Socket, I found this great tool called socat which is similar to netcat/samplicator but has more features.

The man page said: Socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from a large set of different types of data sinks and sources (see address types), and because lots of address options may be applied to the streams, socat can be used for many different purposes.

socat [options] <address> <address>

In my case, to  write some json files to a unix domain socket as client, we can:

cat `pwd`/alert_test.json | socat unix-sendto:/var/suricata/eve_pipe STDIO

There are more examples at:





Leave a Reply

Your email address will not be published. Required fields are marked *