vim /etc/logstash/conf.d/tcp.conf
input{ tcp{ type => "tcp" port => "6666" mode => "server" } } output{ stdout{ codec => rubydebug } }
启动
/opt/logstash/bin/logstash -f tcp.conf
另外其一个窗口使用nc发送
echo "hehe"|nc 10.13.85.9 6666
发送文件内容
nc 10.13.85.9 6666 < /etc/resolv.conf
PS:生产中可以通过这种方式直接发送日志文件(客户端不必安装logstash)