Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Last active December 17, 2015 20:38
Show Gist options
  • Save jordansissel/5668573 to your computer and use it in GitHub Desktop.
Save jordansissel/5668573 to your computer and use it in GitHub Desktop.
tshark + logstash
logstash agent -e '
input {
pipe {
type => tshark
# run tshark unprivileged because it's protocol decoders can be buggy.
command => "sudo tcpdump -w - | tshark -i - -lT fieldstshark -lT fields -E separator=, -E quote=d -e ip.src -e ip.dst -e ip.len"
}
}
filter {
csv {
source => "@message"
columns => [ "src", "dst", "bytes" ]
}
mutate {
remove => "@message"
convert => [ "bytes", "integer" ]
}
}
output {
elasticsearch_http { host => "some-server" flush_size => 50 }
}
'
@tjcwilk
Copy link

tjcwilk commented May 10, 2014

What is the reason that you are piping output from tcpdump to tshark, rather than just running tshark directly?

@codeint-zz
Copy link

what network bandwidth will this impact ELK ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment