diff --git a/GELFUDPInput.json b/GELFTCPInput.json similarity index 68% rename from GELFUDPInput.json rename to GELFTCPInput.json index 63340cb..37b13d1 100644 --- a/GELFUDPInput.json +++ b/GELFTCPInput.json @@ -1,14 +1,13 @@ { "title": "Fluentd", - "type": "org.graylog2.inputs.gelf.udp.GELFUDPInput", + "type": "org.graylog2.inputs.gelf.tcp.GELFTCPInput", "global": true, "configuration": { "bind_address": "0.0.0.0", "decompress_size_limit": 8388608, "recv_buffer_size": 1048576, "number_worker_threads": 4, - "port": 12201, - "recv_buffer_size": 262144 + "port": 12201 }, "node": null } diff --git a/Vagrantfile b/Vagrantfile index 86b20c0..2790636 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -81,7 +81,7 @@ Vagrant.configure("2") do |config| echo "Graylog is available." sleep 5 break - elif [[ $GRAYLOG_STATE != "starting" ]]; then + elif [[ "$GRAYLOG_STATE" != "starting" ]]; then echo "Something is wrong with Graylog. Aborting." exit 1 elif [[ $SECONDS -le 120 ]]; then @@ -93,7 +93,7 @@ Vagrant.configure("2") do |config| fi done - # Check for existing GELF UDP Input + # Check for existing GELF TCP Input INPUTSTATE=$( curl -s -X GET \ -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') for TYPE in $INPUT_TYPES; do - if [[ "$TYPE" == "org.graylog2.inputs.gelf.udp.GELFUDPInput" ]]; then - echo "Found GELF UDP input in Graylog, aborting input installation." + if [[ "$TYPE" == "org.graylog2.inputs.gelf.tcp.GELFTCPInput" ]]; then + echo "Found GELF TCP input in Graylog, aborting input installation." exit fi done - # Install GELF UDP Input + # Install GELF TCP Input curl -i -s -X POST \ -H "Content-Type: application/json" \ -H "X-Requested-By: cli" \ -u admin:admin \ "http://graylog.172.28.128.30.xip.io:8080/api/system/inputs" \ - -d @GELFUDPInput.json + -d @GELFTCPInput.json SHELL end diff --git a/fluentd/fluent.conf b/fluentd/fluent.conf index 15cb599..f8cb2cc 100644 --- a/fluentd/fluent.conf +++ b/fluentd/fluent.conf @@ -42,6 +42,7 @@ @type gelf + protocol tcp host vagrant_graylog_1 port 12201 flush_interval 5s