Created
October 8, 2023 14:16
-
-
Save MParvin/c421714662d06116e419999ed59fe9b1 to your computer and use it in GitHub Desktop.
Check logstash working
This file contains hidden or 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 | |
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