Use this library to build a beats in PHP, implements lumberjack 2 protocol (a sender to logstash/filebeat). Supports compression and TLS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Use this library to build a beats in PHP, implements lumberjeck 2 protocol. Supports compression and TLS

How to use?

To use this library you only need to add it to your composer file running:

composer require berni69/libbeat

Once installed, you can send a "beat" as follows:

require __DIR__.'/vendor/autoload.php';

use libbeat\BeatSender;
$beat = new  BeatSender('', 5044);
$beat->send(["test_log2", "test_log3"]);

To use TLS/SSL you must pass the context options ( to the BeatSender constructor as follows:

$options = array(
             "ssl" => array(
                 "local_cert"        => $MYCERT,
                 /* If the certificate we are providing was passphrase encoded, we need to set it here */
                 "passphrase"        => "My Passphrase for the local_cert",
                 /* Optionally verify the server is who he says he is */
                 "cafile"            => $SSL_DIR . "/" . $SSL_FILE,
                 "allow_self_signed" => false,
                 "verify_peer"       => true,
                 "verify_peer_name"  => true,
                 "verify_expiry"     => true,
$beat = new  BeatSender('', 5044, $options);