Skip to content

Instantly share code, notes, and snippets.

@bactisme
Created March 3, 2017 10:40
Show Gist options
  • Save bactisme/86dc756781ff078b638036fd3cbff4c7 to your computer and use it in GitHub Desktop.
Save bactisme/86dc756781ff078b638036fd3cbff4c7 to your computer and use it in GitHub Desktop.
Capture X seconds of elasticsearch traffic
#!/bin/bash
SECONDS=20
OUTPUT=/root/es_traffic.txt
timeout $SECONDS tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo > $OUTPUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment