Send data via Kong to your Logstash instance provided by Logit.io

Kong

Ship logs from Kong to Logstash

Step 1 - Ensure Kong is Installed Correctly

This guide recommends using the TCP Log Kong plugin. Please see the TCP Log Documentation for more detailed information.

Please ensure that you have Kong installed and at least one Kong service setup before continuing.

Instructions on how to install Kong, as well as how to setup a Kong service, can be found in the Kong Documentation.

Step 2 - Installing

You can either configure the TCP Log plugin to work with a Kong Service, Route or Consumer:

To configure the plugin to work on a Service, use:

curl -X POST http://kong:8001/services/{service}/plugins \
    --data "name=tcp-log"  \
    --data "config.host=your-logstash-host" \
    --data "config.port=your-port" \
    --data "config.tls=true"        

To configure the plugin to work on a Route, use:

curl -X POST http://kong:8001/routes/{route_id}/plugins \
    --data "name=tcp-log"  \
    --data "config.host=your-logstash-host" \
    --data "config.port=your-port" \
    --data "config.tls=true"        

To configure the plugin to work on a Consumer, use:

curl -X POST http://kong:8001/plugins \
    --data "name=tcp-log" \
    --data "consumer_id={consumer_id}"  \
    --data "config.host=your-logstash-host"" \
    --data "config.port=your-port" \
    --data "config.tls=true"            

Step 3 - Sending Logs

You can test sending a log from Kong by sending a request to the service url:

curl --url http://kong:8000/ --header 'Host: example.com'

This will display a log in Kibana. You can use your Logit stack's Logstash filters to better structure incoming Kong logs.

expand view

Expand View

compact view

Compact View

Return to Search
Sign Up