This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
pipe { | |
type => "sflow" | |
command => "/usr/local/bin/sflowtool_wrapper.sh -l -p 6343" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Wrapper script for sflowtool when used in pipe input in logstash. | |
# This wrapper script ensures that the sflowtool is not running prior to start of the sflowtool. | |
ARGS="$@" | |
SFLOWTOOL_PID=$(/bin/ps -ef | /bin/grep "/usr/bin/sflowtool $ARGS" | /bin/grep -v "grep" | /bin/awk ' { print $2 } ') | |
if [ ! -z $SFLOWTOOL_PID ]; then | |
kill -s 9 $SFLOWTOOL_PID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
startDatagram ================================= | |
datagramSourceIP 10.xx.xx.42 | |
datagramSize 185 | |
unixSecondsUTC 1432059370 | |
datagramVersion 5 | |
agentSubId 0 | |
agent 10.xx.xx.12 | |
packetSequenceNo 3861 | |
sysUpTime 11722000 | |
samplesInPacket 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"0x00": NULL | |
"0x01": FIN | |
"0x02": SYN | |
"0x03": FIN-SYN | |
"0x08": PSH | |
"0x09": FIN-PSH | |
"0x0A": SYN-PSH | |
"0x0B": FIN-SYN-PSH | |
"0x10": ACK | |
"0x11": FIN-ACK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"1": tcpmux | |
"2": nbp | |
"4": echo | |
"6": zip | |
"7": echo | |
"9": discard | |
"11": systat | |
"13": daytime | |
"15": netstat | |
"17": qotd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"0": HOPOPT | |
"1": ICMP | |
"2": IGMP | |
"3": GGP | |
"4": IPv4 | |
"5": ST | |
"6": TCP | |
"7": CBT | |
"8": EGP | |
"9": IGP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################# | |
# Sflow Filters # | |
################# | |
filter { | |
if [type] == "sflow" { | |
# sFlow sends two kinds of messages - CNTRs and FLOWs | |
# I'm not doing anything with CNTRs at this point, so |