Skip to content

Instantly share code, notes, and snippets.

@MParvin
Created October 8, 2023 14:16
Show Gist options
  • Save MParvin/c421714662d06116e419999ed59fe9b1 to your computer and use it in GitHub Desktop.
Save MParvin/c421714662d06116e419999ed59fe9b1 to your computer and use it in GitHub Desktop.
Check logstash working
#!/bin/bash
command -v nc 2>&1 >/dev/null
if [[ "$#" < "2" ]]
then
echo "Usage: $0 LOGSTASH_ADDRESS LOGSTASH_PORT"
exit 1
fi
LS_IP=$1
LS_PORT=$2
DATE=`date +%s`
echo "{ 'log': '${DATE} - test logstash'}'" | nc -u -w2 $LS_IP $LS_PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment