1
0
mirror of https://github.com/krislamo/graylog_demo synced 2024-11-09 21:50:35 +00:00

Change Fluentd to use TCP into Graylog

This commit is contained in:
Kris Lamoureux 2020-02-27 13:45:49 -05:00
parent 033207099e
commit 79e77b860e
Signed by: kris
GPG Key ID: A30022791E1719A4
3 changed files with 9 additions and 9 deletions

View File

@ -1,14 +1,13 @@
{ {
"title": "Fluentd", "title": "Fluentd",
"type": "org.graylog2.inputs.gelf.udp.GELFUDPInput", "type": "org.graylog2.inputs.gelf.tcp.GELFTCPInput",
"global": true, "global": true,
"configuration": { "configuration": {
"bind_address": "0.0.0.0", "bind_address": "0.0.0.0",
"decompress_size_limit": 8388608, "decompress_size_limit": 8388608,
"recv_buffer_size": 1048576, "recv_buffer_size": 1048576,
"number_worker_threads": 4, "number_worker_threads": 4,
"port": 12201, "port": 12201
"recv_buffer_size": 262144
}, },
"node": null "node": null
} }

12
Vagrantfile vendored
View File

@ -81,7 +81,7 @@ Vagrant.configure("2") do |config|
echo "Graylog is available." echo "Graylog is available."
sleep 5 sleep 5
break break
elif [[ $GRAYLOG_STATE != "starting" ]]; then elif [[ "$GRAYLOG_STATE" != "starting" ]]; then
echo "Something is wrong with Graylog. Aborting." echo "Something is wrong with Graylog. Aborting."
exit 1 exit 1
elif [[ $SECONDS -le 120 ]]; then elif [[ $SECONDS -le 120 ]]; then
@ -93,7 +93,7 @@ Vagrant.configure("2") do |config|
fi fi
done done
# Check for existing GELF UDP Input # Check for existing GELF TCP Input
INPUTSTATE=$( INPUTSTATE=$(
curl -s -X GET \ curl -s -X GET \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
@ -104,19 +104,19 @@ Vagrant.configure("2") do |config|
INPUT_TYPES=$(echo $INPUTSTATE | jq --raw-output '.states | .[] | .message_input.type') INPUT_TYPES=$(echo $INPUTSTATE | jq --raw-output '.states | .[] | .message_input.type')
for TYPE in $INPUT_TYPES; do for TYPE in $INPUT_TYPES; do
if [[ "$TYPE" == "org.graylog2.inputs.gelf.udp.GELFUDPInput" ]]; then if [[ "$TYPE" == "org.graylog2.inputs.gelf.tcp.GELFTCPInput" ]]; then
echo "Found GELF UDP input in Graylog, aborting input installation." echo "Found GELF TCP input in Graylog, aborting input installation."
exit exit
fi fi
done done
# Install GELF UDP Input # Install GELF TCP Input
curl -i -s -X POST \ curl -i -s -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "X-Requested-By: cli" \ -H "X-Requested-By: cli" \
-u admin:admin \ -u admin:admin \
"http://graylog.172.28.128.30.xip.io:8080/api/system/inputs" \ "http://graylog.172.28.128.30.xip.io:8080/api/system/inputs" \
-d @GELFUDPInput.json -d @GELFTCPInput.json
SHELL SHELL
end end

View File

@ -42,6 +42,7 @@
<match **> <match **>
@type gelf @type gelf
protocol tcp
host vagrant_graylog_1 host vagrant_graylog_1
port 12201 port 12201
flush_interval 5s flush_interval 5s