Using Logstash agent
Last updated
Was this helpful?
Last updated
Was this helpful?
This document describes how to send logs to PacketAI using the logstash http output plugin
In order to complete the setup, there are 2 main things to configure :
Obtain your keys YOUR_PAI_TOKEN and YOUR_PAI_IID by going to https://logpatterns.packetai.co/deploy/agent. Pick any of the integrations to find your keys.
Replace yourclustername
with your cluster name in the mutate block (see below). Note that even if you are not using a proper cluster, you must provide a value for this variable.
Logstash supports several input plugins, the list of input plugins it supports can be found here. The following file input configuration is provided as an example.
Logstash supports several plugins for filtering logs, the more details about several filters (plugins) available here. PacketAI needs some additional fields needs to be attached to each message, see the below mutate section. We need to map the each application message to the following field, [kubernetes][controller][name]
. for example if we have field application_name
in the message, we could map [kubernetes][controller][name] => [application_name]
. The following fields can be static
Logstash several output plugins, more details can be found here. PacketAI use http output plugin of logstash to send the messages to packetai. The http output plugin code snippet can be found below. we need to replace the YOUR_PAI_TOKEN_HERE and YOUR_PAI_IID_HERE with the correct values.
Please replace the YOUR_PAI_TOKEN_HERE and YOUR_PAI_IID_HERE with the correct values from the PacketAI account.
It is advised to test and validate your logstash configuration with below command