Redirect stream in terminal via pipe

Hi Everyone,
I would like to report the amount of TCP-resets per second on the host.
The command I would like to use is

sudo  tcpdump -i eth0 -n -vv 'tcp[tcpflags] & (tcp-rst) != 0' | pv --line-mode --rate >/dev/null

Which outputs the monut of RST per second.

I found this command to be useful to set messages into graylog via netcat

echo -e '{"version": "1.1","host":"example.org","short_message":"Short message","full_message":"Backtrace here\n\nmore stuff","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}\0' | nc -w 1 my.graylog.server 12201

but I struggle to build a pipe to compine it with the data source from a stream.

Can anyone assist?

Thanks a alot!!!

he @mojovski

you need to write a script - bash or whatever fits - to get the value and write that to Graylog. Do you already have a working skeleton that we could verify or do you want us to write you that script?

Jan

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